If your site contains pure static HTML pages, you'll have a tedious time entering the same header and footer HTML tags on all the pages. This is where JavaScript comes to the rescue.
JavaScript allows you to centralize this information in header.js and footer.js files. This way, you call those files in your HTML pages:
<html>
<head></head>
<body>
<!-- Page Header
<script src=header.js>
<!--- Content of the Page -->
<!-- Page Footer
<script src=header.js>
</body>
</html>
Include in the header.js file:
document.write('Header Html tages');
Include in the
footer.js file:
document.write('Footer Html tages');
Another advantage of using JavaScript in this manner is that any changes to your header or footer layout are made only in the JavaScript file, which automatically changes the information in the HTML files.