开发者

How to detect browser support for pageShow and pageHide?

How can we do JavaScript object detection for pageShow and pageHide handlers?

if( /* pagehide is support开发者_如何学JAVAed */ ){
   window.addEventListener('pagehide', exitFunction, false);
}
else{
    window.addEventListener('unload', exitFunction, false);
}


if ('onpagehide' in window) {
   window.addEventListener('pagehide', exitFunction, false);
} else {
   window.addEventListener('unload', exitFunction, false);
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜