[thelist] JS help: including a file as footer

Peter-Paul Koch gassinaumasis at hotmail.com
Wed Jul 24 07:58:07 CDT 2002

>I am working with a website that does not have SSI or PHP (I call it the
>dark ages).
>Rather than hard-code in the footer to every single page, I would like to
>have it maintained in a separate file (let's call it, oh I don't
>know, "footer.html")
>Now what I would like to do is somethine like this
><script type="text/javascript" src="/includes/js/footer.js"></script>
>	<div>
>		<a href="/includes/footer.html">Navigation Page</a>
>	</div>
>Now I don't know jack 'bout JavaScript, and haven't had any luck trying to
>find any good examples of how to have 'footer.js' read the contents of

It can't. The best you can do is

document.write('<a href="/includes/footer.html">Navigation Page</a>');

or something like that.


Chat with friends online, try MSN Messenger: http://messenger.msn.com

More information about the thelist mailing list