Mike,
Try this:
Copy and paste the following into your JS file. Note that
I've put a semicolon after every line save the "{" and
"}":
<script>
function writeNav(){
window.document.writeln("<h2>Site
Navigation</h2>");
window.document.writeln("<ul>");
window.document.writel
n("<li><a
href='index.html'>Home</a></li>");
window.document.writeln("<li><a
href='games.html'>Our games</a></li>");
window.document.writeln("<li><a
href='contact.html'>Contact
Us</a></li>");
window.document.writeln("<li><a href='ref.html'>Useful
Links</a></li>");
window.document.writeln("</ul>");
}
</script>
Then
in your page for the navigation bar, between <head> and </head>,
type:
<script src="nav.js">
</script>
In your body tag you'd type (where
you want the navigation bar to
appear):
<script>
writeNav();
</script>
So that it'd look
like:
<html>
<head>
<script src="nav.js">
</script>
<title>title of
page</title>
</head>
<body>
<script>
writeNav();
</script>
page
content here...
</body>
</html>
Also, I noticed an error with your
script that might have been causing the bar not to
appear:
window.document.writeln("<li><a href='ref.html'>Useful
Links</a></li>
Should be changed to:
window.document.writeln("<li><a
href='ref.html'>Useful Links</a></li>");
I changed it for you in the new
script I've written above so just copy and paste the entire script into
your js file.
HTH,
Munawar