[thelist] Pop up window on exit

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Wed Dec 14 11:31:11 CST 2005


> Can someone point me to a good JavaScript that will render a pop up and
> set a cookie on exit?

1. First inform *clearly* on the page that the user(s) should disable
pop-up blockers to see the really really important window which pops
up on window unload.

2. Secondly attach a handler to the unload event:

<script type="text/javascript>
window.onunload=window_unload;

function window_unload(evt){
WindowObjectReference = window.open("http://www.cnn.com/", "CNN_WindowName",
"menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
}
</script>

(surely, people will want to visit CNN after the page unloads)

The script was taken and modified from

http://www.mozilla.org/docs/dom/domref/dom_window_ref76.html

it was the second link when googling "window.open".

Just out of curiosity, I wonder the importance of that pop-up:

Is it a "thank you for visiting our site" page of some sort, or a
questionaire that pops asking whether your visitors liked the site or
not.

And finally, is there a URL that we may have a look at?


HTH,
--
Volkan Ozcelik
+>Yep! I'm blogging! : http://www.volkanozcelik.com/volkanozcelik/blog/
+> My projects/studies/trials/errors : http://www.sarmal.com/



More information about the thelist mailing list