JQuery "events" is a null error or is not an object "when using empty () or html ()

I get the following error in IE:

'events' - null or not an object - jquery-latest.js? d = 1848173663, line 113 character 467

I am using jQuery 1.4.2, I am not able to update it since we are on an earlier version of the jQuery user interface and have too many errors using anything newer than 1.4.2.

I get the following error when I run this bit of code a second time :

$.post("page/view.do?undoCache=" + Math.random(), {
   pageId: pId
}, function(xmlContent){
   console.log('1');//get this one
   $('#reloadCenterDiv').empty();
   console.log('2');//don't get this one unless line above is commented out, then will run til next line
   $('#reloadCenterDiv').html(xmlContent);
   console.log('3');//don't get this
});

I am sure that I am not doing anything for #reloadCenterDiv between calls.

Google for events error "events" is null or not an object "I found this:

" , ".

. , ?

, , .

, () html() #reloadCenterDiv?

HTML #reloadCenterDiv:

<div id="reloadCenterDiv" style="border:none; margin: 0; overflow:auto; overflow-y:scroll; height: auto;"></div>
+3
2

, , jQuery.cache .

DOM ( ) , jQuery.cache, ​​, .empty(), jQuery , .

:

console.log(jQuery.cache);

, . , - . , jQuery?

, jQuery.cache. .


EDIT:

. .empty() ( cleanData()) jQuery expando -, .

, jQuery , , . - , expando undefined.

jQuery ( 1.4.2) , , events , data undefined.

jQuery if ( data && data.events ) {, , - , events.

+1

jQuery, HTML:

$("#divid").html("");

.

0

Source: https://habr.com/ru/post/1778399/


All Articles