简体   繁体   English

jQuery.load在IE中不起作用?

[英]jQuery.load doesn't work in IE?

This works in FF, but not in IE 7 and 8. Is there anyway to make it work in IE? 这适用于FF,但不适用于IE 7和8。是否有使其在IE中起作用的方法?

setInterval(function() {
    $("#content").load(location.href+" #content>*","");
}, 5000);

(this code is from http://blog.mediasoft.be/partial-page-refresh-with-ajax-and-jquery/ ) (此代码来自http://blog.mediasoft.be/partial-page-refresh-with-ajax-and-jquery/

I'm not sure what the last "" is, but it can be left off, IE may have trouble with the empty data param: 我不确定最后一个""是什么,但可以忽略它,IE可能会遇到空数据参数的问题:

setInterval(function() {
    $("#content").load(location.href+" #content>*");
}, 5000);

Is there any javascript in the returned HTML? 返回的HTML中有任何JavaScript吗? Is so, that could be causing the problem. 是的,那可能是引起问题的原因。 Remove the javascript and put in the parent page in a callback function. 删除JavaScript并将其放在回调函数的父页面中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM