Internet Explorer中的jQuery加载问题 [英] jQuery Load problem in Internet Explorer
问题描述
我在使用jQuery的load函数时遇到麻烦,并希望获得一些帮助.我刚刚开始测试我在IE中内置的网站,以对其进行调试/破解/等操作,以确保其正常工作. Firefox/safari/etc都很好用. .load对我来说不起作用.它似乎挂了.希望有帮助.
I am having troubles with jQuery's load function and am hoping for some help. I just started testing a site I built in IE to debug/hack/etc to make sure it works. Firefox/safari/etc all work great. .load won't work for me though. It just seems to hang. Would love some help.
这是问题的简化版本:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("#links").load("newfull.asp #Body");
});
</script>
</head>
<body>
<div id="links">
test area
</div>
</body>
</html>
可以在 http://www.stephenkiers.com/2010/delete中查看页面. html
推荐答案
您是否尝试过将路径指定为绝对URL,而不是相对于当前文档的路径?
Have you tried specifying the path as an absolute URL instead of relative to the current document?
$("#links").load("/path/to/newfull.asp #Body");
快速浏览jQuery页面显示相对URL应该可以接受,但是我认为值得一试.
A quick look at the jQuery page shows that relative URLs should be acceptable, but its worth a shot I suppose.
是否打算使用#Body
选择body元素或ID为Body
的元素?
Are you intending to use #Body
to select the the body element or an element with the ID of Body
?
这篇关于Internet Explorer中的jQuery加载问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!