Last active
August 29, 2015 14:01
-
-
Save gerasimua/a461ba8399ad937179d4 to your computer and use it in GitHub Desktop.
Confirm tab reload
This file contains hidden or 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.onbeforeunload = function(e) { | |
e = e || window.event; | |
// For IE and Firefox prior to version 4 | |
if (e) { | |
e.returnValue = 'Sure?'; | |
} | |
// For Safari | |
return 'Sure?'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment