Created
July 30, 2012 21:31
-
-
Save marekkalnik/3210450 to your computer and use it in GitHub Desktop.
Kind window.unload popup
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
/** | |
* This won't work in newer FF versions as it doesn't handle onbeforeunload properly. | |
* Need another browser oriented hack... | |
*/ | |
window.onbeforeunload = function (e) { | |
var newwindow; | |
e = e || window.event; | |
newwindow=window.open('http://www.google.com','cool-popup','height=800,width=800'); | |
newwindow.focus(); | |
if (e) | |
{ | |
e.returnValue = 'Would you like to open our super-cool popup?'; | |
} | |
return 'Would you like to open our super-cool popup?'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment