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.
Embedding an HTML file is simple. All we need to do is use the common „<link>“ element. Then we add the value „import“ to the „rel“ attribute. Using „href“ we attach the URL of the HTML file, just like we are used to when it comes to stylesheets and scripts.
Use PRINT or ECHO With this method, you can include the HTML inside of the PHP tags. This is a good method to use for adding HTML to PHP if you only have a line or so to do. "<i>Print works too!
You could use an <iframe> in order to display an external webpage within your webpage. Just place the url of the webpage that you want to display inside the quotes of the src attribute. Show activity on this post. Either you use an iframe or you load the site via AJAX into a div (e.g. using jQuerys load() method).
Have you tried:
<object type="text/html" data="file.html"></object>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With