Forum Moderators: open

Message Too Old, No Replies

Exit Script Popup

Exclude certain url's

         

gosman

11:26 pm on Apr 6, 2004 (gmt 0)

10+ Year Member



I am looking for a script that will popup a window when visitors leave my site. The script must be capable of excluding url's. Example if a vistor leaves my site to go to an affiliate link which I have as a subdomain, I don't want the window to pop. Also I want to cookie the user so the window only pops once per 24 hours. Any help would be really appreciated.

Rambo Tribble

3:29 am on Apr 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I doubt you will find a packaged script to do what you want, but here's what you need to do:

To pop up a window as the current page is left, use the onunload event handler in the body tag of the page to call a function that creates the popup.

The only way you will be able to tell if they are going to an affiliate site is if they use a link on your page. If they enter the URL directly or use a favorites link, that information is unavailable to you.

You can find for cookies a number of places, including any of the O'Reilly books on JavaScript.