Created
April 12, 2017 09:29
-
-
Save 0xffan/9fbb16cc43f9672175ed7b7bc8cf4ff9 to your computer and use it in GitHub Desktop.
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
// https://developer.mozilla.org/en-US/Firefox/Releases/1.5/Using_Firefox_1.5_caching | |
window.onpageshow = function(event) { | |
if (event.persisted) { | |
// the page is loaded from cache | |
} | |
} | |
// in jQuery | |
$(window).bind("pageshow", function(event) { | |
if (event.originalEvent.persisted) { | |
// the page is loaded from cache | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment