How do I execute some code when a user exits a website?

E

Edwin Hannan

Hi All

Do you know if it is possible for me to have the following:

When someone X's out of a website a new window pops up so I can have text in
it such 'Don't miss out on a quote from Metro Blah bah'

Thanks for any suggestions (Javascript?)

cheers

Ed
 
E

Edwin Hannan

thats ok, this is a request from one of my clients, I think he has seen this
on another site and just thought it might be a good idea to alert a
potential customer as a last attempt to offer a free quote.

Well if it cant be done...

thanks

Ed
 
D

David Berry

It can be done with JavaScript on the BODY UnLoad but, as Murray said the
pop up blockers my get it. Also, when you do this you run into another
issue. The pop up will appear not only when you click the "x" to close the
window but it will also happen when you click a link that takes you away
from that page (as that page "unloads") so it would be very annoying to your
visitors if this happened everytime they went back to the home page and then
moved off it.
 
S

Steve Easton

S

Steve Easton

Clicking a link will only fire it if you use onBlur in the body tag, as onblur fires when the page minimizes.
onUnload only fires when the window is closed.


--
Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm

David Berry said:
It can be done with JavaScript on the BODY UnLoad but, as Murray said the
pop up blockers my get it. Also, when you do this you run into another
issue. The pop up will appear not only when you click the "x" to close the
window but it will also happen when you click a link that takes you away
from that page (as that page "unloads") so it would be very annoying to your
visitors if this happened everytime they went back to the home page and then
moved off it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top