...

View Full Version : Script Problem in IE



mortalgod
07-18-2007, 07:27 PM
Hey I have this one line of javascript that works fine in FF but creates a runtime error in IE, iv gone over it over and over and can't figure out whats causing the runtime error, any help would be great, thx


var theString = '<br /><div style="border-top:1px solid white;border-bottom:1px solid white;"><br /><textarea id="commentEditor'+target+'" style="width:383px;" onkeyup="commentChanged('+target+');"></textarea><br /><a href="javascript:saveNewComment('+target+');">Save Changes</a> | <a href="javascript:cancelNewComment('+target+');">Cancel</a></div>';


thx for any help

mortalgod
07-18-2007, 08:42 PM
ok iv narrowed it down a bit:

this line of code works fine:

var theString = '<br /><div style="border-top:1px solid white;border-bottom:1px solid white;"><br /><textarea id="commentEditor'+target+'" style="width:383px;" onkeyup="commentChanged('+target+');"></textarea><br />Save Changes</div>

but if i add in the <a> tag around save changes IE spits out the runtime error:

var theString = '<br /><div style="border-top:1px solid white;border-bottom:1px solid white;"><br /><textarea id="commentEditor'+target+'" style="width:383px;" onkeyup="commentChanged('+target+');"></textarea><br /><a href="#">Save Changes</a></div>

this seems REALY weird to me :S

glenngv
07-18-2007, 09:15 PM
Do you have the page online? When does the error occur?

mortalgod
07-18-2007, 09:18 PM
Do you have the page online? When does the error occur?

the page is in a local testing environment, i uploaded the js file onto my webserver though http://www.ryancooperdesign.com/scripts.js

basicly what happens is i call a javascript function containing that line of code on the onmouseup of an html link, this function then resolves setting this variable and setting the innerHTML of div to match that variable, thats it :S



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum