In my opinion the best solution uses jQuery:
a.html
:
<html>
<head>
<script src="https://stackoverflow.com/questions/8988855/jquery.js"></script>
<script>
$(function(){
$("#includedContent").load("https://stackoverflow.com/questions/8988855/b.html");
});
</script>
</head>
<body>
<div id="includedContent"></div>
</body>
</html>
b.html
:
<p>This is my include file</p>
This method is a simple and clean solution to my problem.
The jQuery .load()
documentation is here.