lolo lolo - 1 month ago 18
HTML Question

Include html file in html using html5

I have 2 HTML files, suppose

a.html
and
b.html
. In
a.html
I want to include
b.html
.

In JSF I can do it like that:

<ui:include src="b.xhtml" />


It means that inside
a.xhtml
file, I can include
b.xhtml
.

How can we do it in
*.html
file?

using html 5 (if it can be done at all in html 5).

Answer

Surprisingly, the same question was asked and it is possible: HTML5 include file

Rafa's answer:


Use the object tag:

<object name="foo" type="text/html" data="foo.inc"/>

foo.inc should include valid HTML.


I tested it on Konqueror, Firefox and Chromium.

If you find it useful (I do), please upvote Rafa answer (not mine) because "it is not possible" is spreading like disease.