开发者

jQuery load() not working in Internet Explorer

开发者 https://www.devze.com 2023-01-14 10:31 出处:网络
I am trying to use jQuery load() function to get content from another page via AJAX.开发者_如何学C It works on Firefox, Google Chrome, but not in Internet Explorer 7 & 8.

I am trying to use jQuery load() function to get content from another page via AJAX.开发者_如何学C It works on Firefox, Google Chrome, but not in Internet Explorer 7 & 8.

Here is the page I am developing: http://139.82.74.22/70anos/no-tempo

All the jQuery code is working normally in Internet Explorer, but the specific part that should bring the destination page isn't. To understand the problem, one must click the "Há 80 anos" or "Há 70 anos" block and click any of the links inside it. It should open a panel underneath the timeline with the content of the block.

Here is the code that pulls the external content:

        jQuery('a.link-evento').click(function() {
            var strUrl = jQuery(this).attr('href');
            var objBlocoConteudo = jQuery(this).parents('div.view-content').next().find('div.conteudo-evento')
            objBlocoConteudo.css('display','block').animate({ opacity: 1}, {duration: 350}).load(strUrl + ' #area-conteudo-evento');
            return false;
        });

With this code I am grabbing the URL of the destination page and telling the browser not to do a normal request, but to open it using jQuery load() function.

Any help appreciated fixing this IE... Thank you.


I'm pretty sure AJAX requests have to be made to a domain name in IE as a security precaution. If you map a domain to your 139.82.74.22 address your problem should go away.

You cant make an .Load(http://139.82.74.22/..), it would have to be .Load("http://mysite.com/mypage")

0

精彩评论

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