Why can't HTML alone do includes?
41–50 of 367 posts
Re: Why can't HTML alone do includes?
#42The 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 example that I create an infinite loop of includes, who is responsible to limit me? How to ensure that all other browsers implement it in the same way?
What happens if I perform an injection from another website? Then we start to have cors policy management to write. (iframes were bad for this)
Now imagine using Javascript I inject an include somewhere, should the website reload in some way? So we have a dynamic DOM in HTML?
Re: Why can't HTML alone do includes?
#43https://en.wikipedia.org/wiki/Transclusion
It was part of Project Xanadu, and originally considered to be an important feature of hypertext.
Notably, mediawiki uses transclusion extensively. It sometimes feels like the wiki is the truest form of hypertext.
Re: Why can't HTML alone do includes?
#44Iframes, while not perfect, are pretty close though...
Interaction between elements in different iframes is very restricted.
The host can then act as a server for the iframe client, even updating it's state or DOM in response to a message from the iframe.
Re: Why can't HTML alone do includes?
#45Isn't this what proper framesets (not iframes) were supposed to do a long time ago (HTML 4?). At least they autoexpanded just fine and the user could even adjust the size to their preference. There was a lot of criticism for frames [1] but still they were successfully deployed for useful stuff like Java API documentation [2]. In my opinion the whole thing didn't stay mostly because of too little flexibility for desig…
Re: Why can't HTML alone do includes?
#46Re: Why can't HTML alone do includes?
#47This 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…
You can message the page dimensions to the parent. To do it x domain you can load the same url into the parent with the height in the #location hash. It won't refresh that way.
We’ve built an industry around solving this problem. What if, for some basic web publishing use cases, we could replace a complex web framework with one new tag?
Re: Why can't HTML alone do includes?
#48> We’ve got , which technically is a pure HTML solution, but they are bad for overall performance, accessibility, and generally extremely awkward here What does this mean? This is a pure HTML solution, not just "technically" but in reality. (And before iframe there were frames and frameset). Just because the author doesn't like them don't make them non-existent.
Re: Why can't HTML alone do includes?
#49Isn't this what proper framesets (not iframes) were supposed to do a long time ago (HTML 4?). At least they autoexpanded just fine and the user could even adjust the size to their preference. There was a lot of criticism for frames [1] but still they were successfully deployed for useful stuff like Java API documentation [2]. In my opinion the whole thing didn't stay mostly because of too little flexibility for desig…
Issue with frame set was way more fundamental: No deep linking, thus people coming via bookmarks or Google (or predecessor) were left on a page without navigation, which people then tried working around with JavaScript, which never gave it a good experience.
Of course "back then" this was an important feature and one of the reasons for getting rid of frames :)
Re: Why can't HTML alone do includes?
#50So, HTML did have includes and they fell out of favor. The actual term include is an XML feature and it’s that feature the article is hoping for. HTML had an alternate approach that came into existence before XML. That approach was frames. Frames did much more than XML includes and so HTML never gained that feature. Frames lost favor due to misuse, security, accessibility, and variety of other concerns.
I still like to use them occasionally but it incurs a "compilation" step to evaluate them prior to handing the result of this compilation to the users/browsers.