Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-15-2005, 01:35 AM   PM User | #1
mtlcoder
New to the CF scene

 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mtlcoder is an unknown quantity at this point
Error saying a global variable is undefined

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
Attached Files
File Type: txt FAQ.txt (5.0 KB, 135 views)
mtlcoder is offline   Reply With Quote
Old 03-15-2005, 04:37 PM   PM User | #2
mtlcoder
New to the CF scene

 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mtlcoder is an unknown quantity at this point
Thanks for all who may have taken the time to look at this; however, the problem has been solved.
mtlcoder is offline   Reply With Quote
Old 03-15-2005, 04:45 PM   PM User | #3
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Quote:
document.write method
...should have used DOM methods instead of document.write() probably you would avoid the error...
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:17 PM.


Advertisement
Log in to turn off these ads.