Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

building a menu problem

Status
Not open for further replies.

VivianL

IS-IT--Management
Jun 10, 2003
2
CA
HI,

I am going to build some menus in my asp file. I copied this from a web page which runs perfectly, but doesn't work in my file. The error message is "Menu is undefined". I guess the problem is in the "menu.js" file which I have no idea what it is. Can anybody help me on how to build or find such a file?

Thanks in advance.

<HTML>
<HEAD>
<META HTTP-EQUIV=expires CONTENT=&quot;fri,31 Dec 1990 10:00:00 GMT&quot;>
<TITLE>Simple Menu</TITLE>
<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot; SRC=&quot;menu.js&quot;></SCRIPT>
<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot;>
<!--
function onLoad() {
window.myMenu = new Menu();
myMenu.addMenuItem(&quot;my menu item A&quot;);
myMenu.addMenuItem(&quot;my menu item B&quot;);
myMenu.addMenuItem(&quot;my menu item C&quot;);
myMenu.addMenuItem(&quot;my menu item D&quot;);
myMenu.writeMenus();
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=&quot;#dddddd&quot;>
<H2>Simple Menu</H2>
<A HREF=&quot;javascript:window.showMenu(window.myMenu);&quot; onMouseOver=&quot;window.showMenu(window.myMenu);&quot;>display myMenu</A>
<P>
This is a sample page that contains simplified menu code.
<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot;>
<!--
if (document.all || document.getElementById) {
onLoad();
}
//-->
</SCRIPT>
</BODY>
</HTML>

 
The line-

<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot; SRC=&quot;menu.js&quot;>

tells you exactly what the .js file is!

It is a seperate file which contains the code.

You need to download it as well and keep it in the same folder as your html page.

~mgb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top