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.
Here is a simplified version of the problem:
<!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>
Page can be viewed at http://www.stephenkiers.com/2010/delete.html
Have you tried specifying the path as an absolute URL instead of relative to the current document?
$("#links").load("/path/to/newfull.asp #Body");
A quick look at the jQuery page shows that relative URLs should be acceptable, but its worth a shot I suppose.
EDIT: Are you intending to use
#Body
to select the the body element or an element with the ID ofBody
?$("#links").load("newfull.asp #Body");
try it without the space
$("#links").load("newfull.asp#Body");
From your question it's not exactly clear if you're only having a problem in IE, but when I hit the supplied page in FF, Chrome and Opera it loads as expected. When I browse to it in IE, I get a blank page as described. Thus, I'm assuming you experience the same thing and IE fails to render like the others.
Tracing the IE request in Fiddler I see the content page (newfull.asp) is requested and delivered, which suggests the problem lies in the jQuery selectors that are passed to the load call. Since it works in the other browser it seems like a quirk the IE DOM related to the specific page (or just a general bug with jQuery and IE). Usually when I hit such problems I check to see how well formed the markup is, and in this case there's a few validation errors. It might be worthwhile to resolve the validation errors and see if it has an impact on IE's behavior.