2 ms·
There used to be a thing for this https://caniuse.com/imports https://caniuse.com/imports
by tln 1y ago
There used to be a thing for this
https://caniuse.com/imports https://caniuse.com/imports
- tehbeard 1y agoNo HTML imports was an idea of using the HTML document format to encapsulate the 3 distinct data types needed for custom elements: - JS for functionality via the custom elements API - HTML for layout via <template> tags. - CSS for aesthetics via <style> tags. Not for just quickly and simply inserting the contents of header.html at a specific location in the DOM.
- HeavyStorm 1y agoSays "superseded by ES modules". Not really the same thing, right?
- tln 1y agoThe article asks about includes but also about imports ("HTML cannot import HTML ") which this is very directly. This feature was billed as #includes for the web [1]. No, it acts nothing like an #include. TBH I don't see why ES modules are a "replacement" here. Personally I would like to see something like these imports come back, as a way to reuse HTML structure across pages, BUT purely declaratively (no JS needed). #includes where partially formed HTML (ie, header.html has a <body> open tag and footer.html has the closing tag) isn't very DOM compatible. [1] https://web.archive.org/web/20181121181125/https://www.html5rocks.com/en/tutorials/webcomponents/imports/ https://web.archive.org/web/20181121181125/https://www.html5...
- moffkalast 1y agoChad QQ and UC browsers, the only ones still supporting HTML imports lmao. I've never heard of them before but I like the cut of their jib.