mortalgos
07-18-2007, 08:01 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>';
i narrowed things down a bit to try and figure it out and I have it narrowed down to one tiny part of the string:
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 thx in advance for any insight
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>';
i narrowed things down a bit to try and figure it out and I have it narrowed down to one tiny part of the string:
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 thx in advance for any insight