Rainbo Design's No-Frames Navigation System
External JavaScript

The contents of the menu seen here on the left is actually stored in a separate JavaScript file. You can update the navigation on your whole site, just by editing this single external file. Its even easier than using frames because you don't have to worry about the TARGET attribute, and you can add links to pages outside your own site without having to worry about them loading inside your frameset by accident. However, it is cumbersome to write JavaScript to generate even modestly-complex HTML code like <a>nchor tags with their requisite attributes that require quotation marks. So, its not the option I generally recommend.

To use an external JavaScript file, just insert the following HTML code in your pages where you want the menu to appear:

<script type='text/javascript' src='menu.js'></script>

Just change the name of the src file to the JavaScript file that generates your menu, as in:

document.writeln('<a href="index.html">Home</a><br>');
document.writeln('<a href="page1.html">Page 1</a><br>');
document.writeln('<a href="page2.html">Page 2</a><br>');

As you can see, the code to get JavaScript to write HTML can be cumbersome, and you have to watch out for quotation marks causing syntax errors.



Click here to return to the Rainbo Design software menu.


No-Frames Navigation System© software Copyright (C) 2003 by Custom Website Design by Rainbo Design. All rights reserved.