Yeah, I never understood why there wasn't an <include> element in HTML, that would just paste the content of the linked document. Why wasn't such an element added in the late 90's or early 2000?
In the early days, when dynamic webpages were processed by something called CGI and even when we started using PHP, this was like 90% of the use case for doing a dynamic webpage. The last 10% might have been some sort of counter.
They weren't common. It depended mainly of the server configuration, language used, etc. Most of the websites were static with some dynamic pages. Includes becane really popular with the rise of PHP and ASP language.
Right, but server-side includes mean unnecessary technology and bandwidth use to work around the absence of a trivial(ish, there are probably a few snags) feature.
> I never understood why there wasn't an <include>
> element in HTML, that would just paste the content of
> the linked document. Why wasn't such an element added
> in the late 90's or early 2000?
As far as I know, for SGML (and therefore old fashioned XML, too), 'include' gets realized via parsing of external &entities;. That's how the Mozilla XUL applications (Seamonkey, Firefox, Thunderbird) etc. realized localization, for example.
I don't know, when XInclude has first been ratified (the current, 2nd revision, of the spec is from 2006), but with it, a generic inclusion mechanism exists for XML, therefore also for XHTML.
With XHTML you could (in theory, as said, the spec is there) use XInclude.
<?xml version='1.0'?>
<html xmlns="http:www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude">
<head>
</head>
<body>
<p>120 MHz is adequate for an average home user.</p>
<xi:include href="disclaimer.xml"/>
</body>
</html>
I am not quite sure, yet, how namespace mixins are handled in XHTML, I think, one must define a new schema (which, honestly is a crappy requirement and should be abandoned), effectively creating an XHTML+XInclude document type, but that may be only a real issue for strict validation.
When I first started out I was using free web hosts that didn't support server-side includes or PHP, so I ended up building my own JavaScript front end framework. Unfortunately, I didn't actually know any JavaScript, so I wrapped every line of my HTML header template in document.write() and included it in a script tag. There were some performance issues.
In the early days, when dynamic webpages were processed by something called CGI and even when we started using PHP, this was like 90% of the use case for doing a dynamic webpage. The last 10% might have been some sort of counter.