PDA

View Full Version : 'good-bye' popup when leaving a site?


quaqualita
10-31-2002, 01:02 PM
I'm designing a web site with about 50 pages. I would like to add a "good-bye -pop-up", meaning to open a window when users are leaving my site. For example, when they leave the site a window opens that says 'thank you for visiting' or so.
I'm using the the on unload event in the body tag: <body on unload="window. open('page.htm')"> . This works as soon the user leaves that particular page where I edit this event in the body tag. However, it also opens when he goes to another page within my site (and it is some silly to say good-bye, while the user is still with me, right?)
What I would like to have is that the user can view different pages of my site and only when he actually leaves the site, then I want to the "good bye window" to pop up.
Can anybody help me out? Thanks in advance!
S.M.L.

aEr_aEr
10-31-2002, 01:26 PM
I don't know how to do this in javascript
but if you make 1 page with 2 frames that lookes like 1 page
then you only have to put <body on unload="window. open('page.htm')"> in the framepage
this page closes just 1 time.

tommysphone
10-31-2002, 02:14 PM
Perhaps have a link on your site called - Leave or Exit. Allocate the event to that link selection perhaps?

Otherwise, build your site into 1 layered page and then that way it will work as intended. BUT the site will be slow to load as each layer is built by the browser.

Not much help. Sorry.

quaqualita
11-01-2002, 09:46 PM
thanks for your advices.
However, I'm not a fan of frames, and I also need a fast loading site.. so to built it in layers is probably not a solution for me either. While doing some re-search I came acroos www.popupmaster.com . There they offer exactly what I need an "pop up on SITE exit" for 69.- US. Maybe I'm going to buy it, I will let you know then, if I found out the solution.

Thanks a lot anyway!
quaqualita