Click to See Complete Forum and Search --> : popup menu is throwing an error


pmcnamee
09-18-2003, 12:06 PM
I'm pretty new to javascript so I am still using Dreamweaver to generate certain effects on my page for www.Granitearch.com. I tried to add some popup menus and I am getting an error from the following line of code, which causes all of the mouseovers to throw errors as well.

window.mm_menu_0809150125_0_1 = new Menu ("Classes",128,18,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#FFFFFF","#CCCCCC","#000084","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);

The error is as follows:
line: 10
char: 23
error: 'Menu' is undefined
code: 0


from looking at the code, it appears that Menu is a keyword. What am I missing.

Please help,

Pete McNamee
JavaScript Rookie

dragle
09-18-2003, 01:29 PM
The error you mentioned is actually the second error being thrown on that page; the first is in the mm_menu.js file and is triggered by this (partial) statement:

var dClose = '</div>' if (menu.bgImageUp) ...

That statement is missing a trailing newline or (preferably) semi-colon:

var dClose = '</div>'; if (menu.bgImageUp) ...

and since mm_menu.js doesn't load correctly, the Menu constructor (which is in mm_menu.js) that you need for the line you posted is never fully defined.

Just glancing at it it looks like your mm_menu.js is all defined on a single line, yet there are tabs (?) as if the code is supposed to be indented. Thus, my guess is that at some point it was a multi-line file, but all the newlines got stripped out of it. Possibly the result of FTP'ing an ascii file back and forth from the server as a binary file? At any rate, you may have other problems with that mm_menu.js file as is, too; I recommend that you figure out what happened to its formatting and correct it before moving on.

Cheers!

pmcnamee
09-18-2003, 02:48 PM
Thanks a lot. It wasn't the ftp transfer that messed things up. The semi-colon was actually missing in the code. I uploaded it and everything is working fine now. Thanks for your help.

Pete

dragle
09-18-2003, 03:04 PM
You're welcome!