Equivalent of include() in HTML
It cannot be done purely by HTML. (There are iframes, however, but I don't think that qualifies in this case.)
It can be done using JavaScript. You get the other file via Ajax, and place its contents inside an HTML element on the current page.
Shameless plug of a library that I wrote the solve this.
https://github.com/LexmarkWeb/csi.js
<div data-include="/path/to/include.html"></div>
The above will take the contents of /path/to/include.html
and replace the div
with it.
HTML does not have a feature to include additional content natively. However most web servers do have server-side include statements:
SSI in Apache
SSI in IIS
Have you tried:
<object type="text/html" data="file.html"></object>