Created
January 19, 2016 11:23
-
-
Save simplelife7/3218db482fafdc5d1d90 to your computer and use it in GitHub Desktop.
【JS】判断页面是否从缓存取的onpageshow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('pageshow', function(e) { | |
if (e.persisted) {// 从缓存加载 | |
//... | |
} | |
}, false); | |
//jquery中没有这个对象,需要用原生事件对象 | |
$(window).bind("pageshow", function(event) { | |
if (event.originalEvent.persisted) { | |
//.. | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment