I too lamented the loss of HTML imports and ended up coming up with my own JavaScript library for it. https://miragecraft.com/blog/replacing-html-imports At the end of the day it’s not something trivial to implement at the HTML spec/parser level. For relative links, how should the page doing the import handle them? Do nothing and let it break, convert to absolute links, or remap it as a new relative link? Should the…
Why can't HTML alone do includes?
271–280 of 367 posts
Re: Why can't HTML alone do includes?
#272Re: Why can't HTML alone do includes?
#273Netscape 4 has this with inflow layers — ` ` https://web.archive.org/web/19970630074729fw_/http://develop... https://web.archive.org/web/19970630094813fw_/http://develop...
Re: Why can't HTML alone do includes?
#274This was the rabbit hole that I started down in the late 90s and still haven’t come out of. I was the webmaster of the Analog Science Fiction website and I was building tons of static pages, each with the same header and side bar. It drove me nuts. So I did some research and found out about Apache server side includes. Woo hoo! Keeping it DRY (before I knew DRY was a thing). Yeah, we’ve been solving this over and ove…
I've become a fan of https://htmx.org for this reason. A small 10KB lib that augments HTML with the essential good stuff (like dynamic imports of static HTML)
$ curl --location --silent "https://unpkg.com/htmx.org@2.0.4" | wc -c
50917
$ curl --location --silent "https://unpkg.com/htmx.org@2.0.4" | gzip --best --stdout | wc -c
16314Re: Why can't HTML alone do includes?
#275Earlier quoted context omitted.
It's too bad we didn't go down the XHTML/semantic web route twenty years ago. Strict documents, reusable types, microformats, etc. would have put search into the hands of the masses rather than kept it in Google's unique domain. The web would have been more composible and P2P. We'd have been able to slurp first class article content, comments, contact details, factual information, addresses, etc., and built a wealth…
Me personally, I didn't even care that much about strict semantic web, but XML has the benefits of the entire ecosystem around it (like XPath and XSLT), composable extensibility in form of namespaces etc. It was very frustrating to see all that thrown out with HTML5, and the reasoning never made any sense to me (backwards compatibility with pre-XHTML pages would be best handled by defining a spec according to which t…
Re: Why can't HTML alone do includes?
#276Re: Why can't HTML alone do includes?
#277Earlier quoted context omitted.
It's too bad we didn't go down the XHTML/semantic web route twenty years ago. Strict documents, reusable types, microformats, etc. would have put search into the hands of the masses rather than kept it in Google's unique domain. The web would have been more composible and P2P. We'd have been able to slurp first class article content, comments, contact details, factual information, addresses, etc., and built a wealth…
I'm as big a critic of Google as anyone, but I'm always surprised at modern day takes around the lost semantic web technologies - they are missing facts or jumping to conclusions in hindsight. Here's what people should know. 1) The failure of XHTML was very much a multi-vendor, industry-wide affair; the problem was that the syntax of XML was stricter than the syntax of HTML, and the web was already littered with brok…
Google does support multiple semantic web standards: RDFa, JSON+LD and I believe microdata as well.
JSON+LD is much simpler to extract and parse, however it makes site HTML bigger because information gets duplicated compared to RDFa where values could be inclined.
Re: Why can't HTML alone do includes?
#278Earlier quoted context omitted.
What bug specifically?
Couldn't find a good link earlier, guess I didn't have quite the right keywords for search. Here we go, looks like its 17 years old now: https://bugzilla.mozilla.org/show_bug.cgi?id=98168#c99
Re: Why can't HTML alone do includes?
#279Re: Why can't HTML alone do includes?
#280I'm not an expert on this but IMO, from a language point of view, HTML is a markup language, it 'must' have no logic or processing. It is there to structure the information not to dynamically change it. Nor even to display it nicely. The logic is performed elsewhere. If you were to have includes directly in HTML, it means that browsers must implement logic for HTML. So it is not 'just' a parser anymore. Imagine for e…
* the actual existence of frames (although those are deprecated)
* iframes (which are not deprecated, so seemingly doing declarative inclusion of HTML in HTML was not what was wrong with frames)
* imports in CSS, which share some of the same problems / concerns as HTML imports
* the existence of JavaScript with its ability to change anything on the page, including the ability to issue HTTP requests and be written arbitrarily obfuscated ways.