By using this site, you agree to our Privacy Policy and our Terms of Use. Close

When I work with web design, I generally use PHP when creating 'include' files that have information that doesn't change depending on the page. For school, I'm recoding my entire school's website because, well, the last web designer though putting tables inside tables was the best way to create a layout for a website. >_>; However, the schools webserver doesn't support PHP and therefore, I'm restricted to using Javascript to accomplish something similar to this. But, I'm not a Javascript expert and I can't figure out why my code isn't working. include.js: function header() { document.writeln("<html>"); document.writeln("<head>"); document.writeln("<title>Hereford High School</title>"); document.writeln("<style type="text/css">"); document.writeln("<!-- @import url("/style.css"); -->"); document.writeln("</head>"); document.writeln("<body>"); document.writeln("Test Header"); } function footer() { document.writeln("Test Footer");

document.writeln("</body>"); document.writeln("</html>"); } index.html:

<script src="/include.js"></script>

<script language="JavaScript">header();</script>

Test

<script language="JavaScript">footer();</script>