简体   繁体   中英

.load() does not work on IE

I am trying to have a little dynamics work in this website http://peps.sqps.nl Everything seems to work well untill I test the website in IE, it just doesnt give any content back.

The js I use is as following:

$(document).ready(function(){
$('li.navItem a').click(function(){
    var url = $(this).attr('href');

    $('article').load(url + ' article', function(){
        $('article').fadeTo(1200, 1);
    });

    return false;
});
});

the html of the dynamic part is as following, where the <article></article> part is supposed to act dynamicly.

<section id="content">
  <div id="article">
    <article>
         content is in here
    </article>
  </div>
</section>

The solution given here on similar problems didnt fix the bug Anyone has any ideas?

Thnx!

Your URL looks like it would be badly formed.

url = "http://site.com/path/to/page"
load_url = url + ' article'
alert(load_url); // Displays "http://site.com/path/to/page article"

Is this what you really want?

Add .each(function(){...}); after .load , it should works in IE and Chrome.

        $('#<%=image1.ClientID %>').load(function () {
            //things to do
        }).each(function () {
            if (this.complete) $(this).load();
        });

Probably the IE is making cache of your code.

See this post: jQuery's .load() not working in IE - but fine in Firefox, Chrome and Safari

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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