Hacker News new | ask | show | jobs
by CamouflagedKiwi 418 days ago
That's the first thing listed in the article? "Javascript to go fetch the HTML and insert it". What they're after is something that's _just_ HTML and not another language.
2 comments

The <object> tag appears to include/embed other html pages.

An embedded HTML page:

<object data="snippet.html" width="500" height="200"></object>

https://www.w3schools.com/tags/tag_object.asp

hunh - THAT's cool. Learn something new every day.

That said - it does appear encapsulated, much like an iframe - css doesn't take, etc. so though more "pure" HTML I'd argue doesn't fulfill the spirit of "include"?

While you do need a server i think this is the functional equivalent? The fetch JS and insert outlined (linked to) in the article is async. This blocks execution like you'd expect an HTML include to do. It's WAY easier to reason about - which is why the initial ask, I think...