Last active
June 13, 2017 08:26
-
-
Save rehrumesh/4878fbb0f7b77e0edac452be227b3951 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
window.onbeforeunload = function(e) { | |
if (window.location.href.includes("sometext")) { | |
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