View Full Version : Popup on Close
robe03
12-24-2003, 11:45 AM
I am trying to add a popup on window close that thanks the viewer for visiting the page. Most of the scripts I have found on the web offer this but the popup comes even when the back button is pressed or another link is accessed. Does anyone know a script that prompts a popup only on close, or is this script even possible.
Thanks for your help.
n8thegreat
12-24-2003, 11:54 AM
first of all, websites that do that sort of thing are super super super annoying. if i close the window, i want it closed, i dont want a stupid pop up coming up no matter what its for. its almost as bad as loading it with tons of spinning gifs and midi background music. as far as i know, you cant really do it only when the window is closed in all browsers. mozilla has a window.onclose event. you can try that, but i would advise you to just not do it :)
<script type="text/javascript">
window.onclose = function() {
var win = window.open(asdasd);
}
</script>
robe03
12-24-2003, 01:08 PM
I agree, but sometimes you can only argue a point with a client for so long and you just have to let it go
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.