问题描述
我正在尝试使用jquery .live()加载javascript并将其绑定到pageshow.但是,这不适用于IE(图!),是否存在我可以绑定到IE的兼容事件?
I'm trying to load javascript using jquery .live() and binding it to pageshow. However, this doesn't work with IE (figures!), is there a compatible event I can bind to for IE?
$(".root").live('pageshow', function(event, ui) {
alert("HERE");
});
推荐答案
请参见此答案,由托里"(thorie)撰写,类似的问题.他检查隐藏字段(脏位)的想法适用于IE和Chrome.然后添加单独的一行以在Firefox中工作;绑定到pageshow
并检查event.originalEvent.persisted
.
See this answer by 'thorie' to a similar issue. His idea of checking a hidden field (dirty bit) works in IE and Chrome. Then you add in a seperate line to work in Firefox; bind to pageshow
and check event.originalEvent.persisted
.
我可能为时已晚,无法为您提供帮助,但是希望其他人可以找到这种用法(或者我会因为我的愚蠢而得到纠正吗?!).
I may be two years too late to help you, but hopefully someone else may find this of use (or I will be corrected for my idiocy perhaps?!).
这篇关于IE浏览器的jQuery页面显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!