Pure HTML (without JavaScript) cannot load in another page on it's own. However, you can use PHP, SHTML, or JavaScript to obtain another page and load it into the page.
PHP
Make sure that your HTML file has been renamed with the .php extension. Then you can add the following line where you want to add the HTML file:
<?php include('some_file_name.html'); ?>
As long as some_file_name
exists, that page will load in where the PHP tag is.
SHTML
Make sure that your HTML file has been renamed with the .shtml extension. Then you can add the following line where you want to add the HTML file:
<!--#include virtual="some_file_name.html" -->
Again, as long as some_file_name
exists, the page will load in the page at that. Be sure to watch for spacing, especially between the second dash and #
, as the line of code will break if there is a space.
JavaScript
The plus side of using JavaScript is that you can keep your HTML file a .html file. However, more code is needed to load in the included file:
<script src="jquery.js"></script>
<script>
$(function(){
$("#includeThis").load("some_file_name.html");
});
</script>
...
<div id="includeThis"></div>
This will create a function that will load some_file_name.html
where the div id of includeThis
is located. This contains more overhead, but you can keep your .html file extension.