Created
May 1, 2012 03:12
-
-
Save tvpmb/2564663 to your computer and use it in GitHub Desktop.
How to capture browser forward/back/refresh navigation
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).on('beforeunload', function(e) { | |
//confirm('UNLOAD', 'UNLOAD'); | |
e.preventDefault(); | |
//e.stopPropagation(); | |
console.log('page navigation cancelled'); | |
//debugger; | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment