views:

15

answers:

1

here is what i need to do:

i want to launch a popup window when the user exits the website.

i found code that detects when the user closes the window, but that same code ALSO fires when the user clicks on an internal link. ( which i dont want )

any ideas how to do this? Ive looked everywhere and i cant find a clear solution.

this solution needs to work on all 3 browsers : FFox / IE / Safari!

thanks!

A: 

You can't, there is no such event that will be triggered when someone exits the site. That's why in the early 2000s someone too clever invented "pop-unders": popups that will open immediately, but will be put on the background, behind the browser's window.

Which are one of the most annoying things on the web, and the first ones that any popup blocker or antivirus will kill :) On the other side, there are legitimate uses for that, like most surveys you see (I got one from microsoft some days ago).

Never rely on popups, unless you are writing an intranet site, or one where you are sure all of your visitors will not have a popup blocker.

Palantir

related questions