为什么 .html() 在 Internet Explorer 7 中不起作用
我有一个 asp.net-mvc 网站,我在 Internet Explorer 7 的一个页面上遇到奇怪的行为,其中 ajax 调用的 html 结果没有显示在屏幕上。这在 Firefox、Chrome 和 IE8 中完美运行。
我首先认为它与 ajax 相关,但为了简化和隔离问题,我发现它在 IE7 中不起作用
$("#cupcakeOfMonthYear").live("click", function () {
$('#cupcakeOfMonthCalendar').html("ffffff");
});
再次,这在 Firefox、Chrome 和 IE8 中工作完美,但当我更改为兼容模式以获得 IE7 体验时,整个 div 区域变为空白(而不是使用更新后的 html 进行刷新)。
这是IE7的bug吗?
i have an asp.net-mvc site and i am getting weird behavior in internet explorer 7 on one page where the html result of an ajax call isn't showing up on the screen. This works perfect in Firefox, Chrome and IE8.
I first thought it was ajax related but to simplify and isolate the issue i got this to NOT work in IE7
$("#cupcakeOfMonthYear").live("click", function () {
$('#cupcakeOfMonthCalendar').html("ffffff");
});
Again, this works perfect in Firefox, Chrome and IE8 but when i change to compatibility mode to get the IE7 experience, the whole div area goes blank (instead of refreshing with the updated html).
Is this a bug in IE7?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想通了这个问题。我在表选择器本身上调用
,似乎 IE7 不喜欢这样。我在桌子周围放置了一个 div,当桌子从 ajax 调用返回时。我调用
了外部 div,效果很好。它实际上是有道理的,因为 .html() 似乎不包含外部 html,但我想所有现代浏览器都会弄清楚并做正确的事情。
i figured out the issue. i was calling
on the table selector itself and it seems like IE7 doesn't like this. i put a div surrounding the table and when the table came back from the ajax call. i called
on the outer div and that worked fine. It actually makes sense as .html() doesn't seem to include the outer html but i guess all modern browsers figure it out and do the right thing anyway.
您使用的是哪个 jquery 阻塞库(以及哪个版本)?
我主要了解 blockUI ,
它似乎有一个 相关SO帖子关于您的问题。
Which jquery blocking library (and which version) are you using ?
I mostly know of blockUI
Which seems to have a related SO post on your problem.