I am having a terrible time getting an external .js file to work. I have the following code:
<!– Keep all menus within masterdiv–>
<div id=”masterdiv”>
<div class=”menutitle” onclick=”SwitchMenu(‘sub1’)”>Site Menu</div>
<span class=”submenu” id=”sub1″>
– <a href=”new.htm”>What’s New</a><br>
– <a href=”hot.htm”>What’s hot</a><br>
– <a href=”revised.htm”>Revised Scripts</a><br>
– <a href=”morezone/”>More Zone</a>
</span>
</div>
I want to copy this into a menu.js file and not have to include the code on
every page. I have expanded the menu into several subsets so code is much
longer than above. Do I just copy the code above as is into a menu.js file or do I need to do something else with it???
Once that is done, how do I reference the menu.js file on each page of the
web site to get the menu to appear? I’ve tried all kinds of combinations from
web site help pages and a couple of books I have and can’t seem to find the
right combo. There is another section of code that goes in the HEAD section
but that is included in my page template and on every page which is not a
problem. I just want the above in a separate menu.js file so when I have to
change something in the menu I do not have to do it 30 times.
Thanks in advance.
K