...

View Full Version : IE throwing an error i need fixed



godofreality
05-29-2009, 07:36 AM
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



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

Old Pedant
05-29-2009, 07:57 AM
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:


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.

godofreality
05-29-2009, 08:04 AM
lol ok i new i forgot sumthing when i was making the post


line 93:
eval("game"+x+"_character"+z+"_server = ''");



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum