【发布时间】:2011-05-19 23:44:59
【问题描述】:
我在 IE 中收到以下错误:
'events' 为 null 或不是对象 -- jquery-latest.js?d=1848173663,第 113 行字符 467
我正在使用 jQuery 1.4.2,我还不能升级,因为我们使用的是旧版本的 jQuery UI,并且使用比 1.4.2 更新的任何东西都有太多错误。
第二次运行这段代码时出现以下错误:
$.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
});
我很确定在两次通话之间我没有对#reloadCenterDiv 做任何其他事情。
搜索错误“'events' is null or not an object”我发现了这个:
“听起来像是对事件的引用 处理程序仍然存在,当 处理程序本身已经消失了。”
这听起来合乎逻辑。关于为什么以及何时会发生此错误的任何其他想法?
我找到了发生这种情况的地方,但我的所有线索都到此为止了。
如何清理这些东西以便我可以再次在#reloadCenterDiv 上调用empty() 或html()?
这是#reloadCenterDiv 的 HTML:
<div id="reloadCenterDiv" style="border:none; margin: 0; overflow:auto; overflow-y:scroll; height: auto;"></div>
【问题讨论】:
标签: javascript jquery ajax event-handling dhtml