Created
February 19, 2019 18:00
-
-
Save pulketo/2a31beaa43687612aa08eea66fc59524 to your computer and use it in GitHub Desktop.
Javascript Html Reload if back button
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 ( event ) { | |
var historyTraversal = event.persisted || | |
( typeof window.performance != "undefined" && | |
window.performance.navigation.type === 2 ); | |
if ( historyTraversal ) { | |
// Handle page restore. | |
window.location.reload(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment