开发者

.load() does not work on IE

开发者 https://www.devze.com 2023-04-08 04:22 出处:网络
I am trying to have a little dynamics work in this webs开发者_JAVA百科ite http://peps.sqps.nl Everything seems to work well untill I test the website in IE, it just doesnt give any content back.

I am trying to have a little dynamics work in this webs开发者_JAVA百科ite 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?


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


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();
        });
0

精彩评论

暂无评论...
验证码 换一张
取 消