jQuery的.load()在IE中不起作用 - 但在Firefox,Chrome和Safari中都很好 [英] jQuery's .load() not working in IE - but fine in Firefox, Chrome and Safari

查看:594
本文介绍了jQuery的.load()在IE中不起作用 - 但在Firefox,Chrome和Safari中都很好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在墙上碰到了这个... ...

I'm hitting my head on the wall against this one ...

我有以下代码:

$("#home").click(function(e) {
    $(".tabs").attr("src","tabs-home.gif");
    $(".islice").hide('fast');
    $(".islice").load("home.html");
    $(".islice").show('fast');  
    e.preventDefault();
});

它在Firefox,Safari和Chrome中运行得非常好,但IE只运行attr()而不是做隐藏/显示或加载。我尝试删除隐藏和显示它仍然无效。

It works perfectly fine in Firefox, Safari and Chrome, but IE only runs attr() and does not do either the hide/show or the load. I tried removing the hide and show and it still does not work.

IE报告没有语法错误,即使使用DebugBar。我可能做错了什么?

IE reports no syntax errors, even with DebugBar. What could I be doing wrong?

您可以在 http://www.brick-n-mortar.com

推荐答案

我有同样的问题。我发现的许多网站都建议IE可能会缓存你的代码并建议将代码附加到

I am having the same problem. Many sites I have found have suggested that IE may be caching your code and suggest to append the code to

$("#home").click(function(e) {
    $(".tabs").attr("src","tabs-home.gif");
    $(".islice").hide('fast');
    $(".islice").load("home.html?" + new Date().getTime() );
    $(".islice").show('fast');
    e.preventDefault();
});

这应确保IE不缓存。

请参阅 http://zacster.blogspot .com / 2008/10 / jquery-ie7-load-url-problem.html 了解更多信息。

这篇关于jQuery的.load()在IE中不起作用 - 但在Firefox,Chrome和Safari中都很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆