JQuery loading issue in Internet Explorer

I am having problems with the jQuery load function and I hope 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 works fine..load won't work for me. It seems to be hanging. I would like to help.

Here's 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>

      

The page can be viewed at http://www.stephenkiers.com/2010/delete.html

+2


source to share


3 answers


Have you tried specifying the path as an absolute URL and not 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 ok, but worth it in my opinion.

EDIT: Are you going to use #Body

to select the body element or the element with id Body

?

+3


source


From your question, it is not entirely clear if you only have a problem in IE, but when I get to the supplied page in FF, Chrome and Opera load as expected. When I view it in IE I get a blank page as described. Thus, I assume you are experiencing the same and IE may not look like the others.



Tracking IE request in Fiddler. I can see that the content page (newfull.asp) is being requested and delivered, indicating that the problem is with the jQuery selectors being passed to the load call. Since it works in a different browser, this looks like a page-specific IE DOM quirk (or just a common bug with jQuery and IE). Usually when I run into problems like this, I check how well the markup is formed, in which case there are several validation errors . It might be worth solving the validation errors and see if that affects IE's behavior.

+2


source


$ ("# links"). load ("newfull.asp #Body");

try it without space

$ ("#" link) load ("newfull.asp # Body") ;.

0


source







All Articles