2009/02/23

'nodeName' is null or not an object error in IE

Says you have code like below
<div id="place1">ABC</div> ... <div id="place2">EFG</div> Then you try to update those div using jquery's html method, and the html result from ajax will be insert into this div, like
$('#change').html(data); //data is from ajax call Which works fine on Firefox, but fails on IE. The message you will get is that, 'nodeName' is null or not an object The fixes is that clearing the value in that div before assign anything into it, like,
$('#change').html(); //clear div $('#change').html(data); The version of the jQuery used to product this error is 1.2.6

No comments:

Post a Comment