...

View Full Version : Error saying a global variable is undefined



mtlcoder
03-15-2005, 01:35 AM
I've been working at this for a couple of days now, and can't figure it out. I have defined my own menu object, and have made a global instance of it (m). I am using the document.write method to write out a link which should execute one of my functions (using the global instance as a parameter). For some reason when I click on it, I get the error "'m' is undefined". However, if I type the link into the body manually, it works just fine. Any help would be greatly appreciated. Thanks!!

BTW - I've attached my code. Please note that this has been simplified from the original version which used frames, so the LoadMain function is incorrect. I just wanted to get the function calls going first, and then I'll worry about the display.

Thanks again :)

mtlcoder
03-15-2005, 04:37 PM
Thanks for all who may have taken the time to look at this; however, the problem has been solved. :)

Kor
03-15-2005, 04:45 PM
document.write method

...should have used DOM methods instead of document.write() probably you would avoid the error... :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum