Created
November 13, 2013 00:04
-
-
Save filipkral/7441074 to your computer and use it in GitHub Desktop.
Stay on page. I use this to prevent me from leaving ArcGIS API for JavaScript Sandbox (http://developers.arcgis.com/en/javascript/sandbox/sandbox.html) accidentally by pressing escape when the focus is not on the code editor.
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
// to open a confirm dialog before you leave the page, enter this into the browser console (or the javascript code) | |
window.onbeforeunload = function(e){ var e = e || window.event; var msg ="Don't leave!"; if(e){e.returnvalue = msg;} return msg; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment