4 ms·
What's missing from HTML is simple client side includes. It's mind boggling that it doesn't exist. XML has it - I can resuse the same image with a tag, but not
by DrScientist 7y ago
What's missing from HTML is simple client side includes.
It's mind boggling that it doesn't exist. XML has it - I can resuse the same image with a tag, but not HTML??
Why can't we have the same logic of SSI implemented in the browser?
Probably the perfect being the enemy of the good again.
This experiment by Jake Archibald looks interesting in this area.
https://github.com/jakearchibald/streaming-include https://github.com/jakearchibald/streaming-include
- petercooper 7y agoHere's another approach: https://www.filamentgroup.com/lab/html-includes/ https://www.filamentgroup.com/lab/html-includes/ <iframe src="/images/includespost/htmlexample.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe> Given that Googlebot will render and use JavaScript now, I'd be intrigued as to whether this works with it, but client side it seems OK.
- DrScientist 7y agohttps://github.com/jakearchibald/streaming-include/blob/master/research.md https://github.com/jakearchibald/streaming-include/blob/mast... Also lists alternatives - see how whatwg request is bogged down in what/if complexity.