1> iframe 사용
<html>
<body>
<iframe src="http://opentutorials.org" width="500" height="500" sandbox></iframe>
</body>
</html>
2> jquery 사용
$(document).ready(function(){
$(#header).load("/header.html");
$(#footer).load("/footer.html");
});
3> 자바스크립트 AJAX 사용
<body>
<div data-include-path="footer.html"></div>
<script>
window.addEventListener('load', function() {
var allElements = document.getElementsByTagName('*');
Array.prototype.forEach.call(allElements, function(el) {
var includePath = el.dataset.includePath;
if (includePath) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
el.outerHTML = this.responseText;
}
};
xhttp.open('GET', includePath, true);
xhttp.send();
}
});
});
</script>
</body>