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 05-29-2009, 06:36 AM   PM User | #1
godofreality
Regular Coder

 
godofreality's Avatar
 
Join Date: Jan 2009
Posts: 230
Thanks: 1
Thanked 15 Times in 15 Posts
godofreality can only hope to improve
IE throwing an error i need fixed

IEs error console thing from the status bar...
Line: 93
Char: 5
Error: Object doesn't support this property or method
Code: 0

i will not post the whole code here bcuz it is very large but i will put the specific section it is referring to

Code:
		for ( x = 0; ( x + 1 ) <= NoG; x++ )
			{
			game[x] = "";
			game[x] = document.getElementById('game'+[x]).value;
			
			for ( z = 0; ( z + 1 ) <= NoC; z++ )
				{
				eval("game"+x+"_character"+z+" = ''");
				eval("game"+x+"_character"+z+"_server = ''");
				eval("game"+x+"_character"+z+" = document.getElementById('game'+x+'_character'+z).value");
				eval("game"+x+"_character"+z+"_server = document.getElementById('game'+x+'_character'+z+'_server').value");
				}
			}
i know eval is "evil" and all that stuff but it is the only way to perform the job i need performed by the code now i have no clue why this is throwing an error in IE bcuz it works great in firefox

if you can help me the help would be greatly appreciated
godofreality is offline   Reply With Quote
Old 05-29-2009, 06:57 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,249
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Ummm...but you don't say *WHICH* is line 93.

Or which object the message is referring to.

If the culprit is in one of those eval( ) calls, then the obvious debugging step is to duplicate the eval( ) call with an alert:
Code:
alert("game"+x+"_character"+z+" = ''");
eval("game"+x+"_character"+z+" = ''");
alert("game"+x+"_character"+z+"_server = ''");
eval("game"+x+"_character"+z+"_server = ''");
alert("game"+x+"_character"+z+" = document.getElementById('game'+x+'_character'+z).value");
eval("game"+x+"_character"+z+" = document.getElementById('game'+x+'_character'+z).value");
alert("game"+x+"_character"+z+"_server = document.getElementById('game'+x+'_character'+z+'_server').value");
eval("game"+x+"_character"+z+"_server = document.getElementById('game'+x+'_character'+z+'_server').value");
See exactly what it is trying to eval, to make sure it's what you expect.
Old Pedant is online now   Reply With Quote
Old 05-29-2009, 07:04 AM   PM User | #3
godofreality
Regular Coder

 
godofreality's Avatar
 
Join Date: Jan 2009
Posts: 230
Thanks: 1
Thanked 15 Times in 15 Posts
godofreality can only hope to improve
lol ok i new i forgot sumthing when i was making the post


line 93:
Code:
eval("game"+x+"_character"+z+"_server = ''");
godofreality 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 04:58 AM.


Advertisement
Log in to turn off these ads.