Search code examples
phphtmlfunctionincludeserver-side-includes

Equivalent of include() in HTML


I was wondering wether there is a way to include some html content inside another html using only html?

A replacement to PHP's

<?php include("file.php"); ?>

Is this possible?

EDIT:

This has brought up some confusion, what I needed was "almost an html tag" that had the functionality of including a html document in another.


Solution

  • 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.