how to pop an exit console correctly

J

John Hoge

I would like to open an exit pop when a user leaves my site, but I
don't want to the back button to trigger the pop if the user remains
in my site.

I'm using the onUnload attribute of the Body tag to do this. All
internal links set a variable of inSite to true on their onClick event
handler, so the exit pop will not open if the user follows an internal
link.

Should the user hit the back button, the pop will be displayed. Is
there a better, cleaner way to determine when the user has left a
site?
 
R

Randy Webb

John said:
I would like to open an exit pop when a user leaves my site, but I
don't want to the back button to trigger the pop if the user remains
in my site.

So, when they decide to leave your site, you either want to ask them if
they are sure "Are you sure you really want to leave my site", you want
to popup an advertisement "Hey, you left my site, will you buy
something?", or, you want to popup something else? Nice.....
I'm using the onUnload attribute of the Body tag to do this. All
internal links set a variable of inSite to true on their onClick event
handler, so the exit pop will not open if the user follows an internal
link.

I wont see the popup either way. Whether onSite or offSite. My popup
blocker ensures that I won't see it.
Should the user hit the back button, the pop will be displayed. Is
there a better, cleaner way to determine when the user has left a
site?

Yes, stop trying.

What happens if I open your main page, then I navigate to a sub-page,
and then type in the URL to the main page again. Should I get the popup?
I didn't navigate away from the page via a link, yet I would get the
popup even though I am still on your site?
 
K

kaeli

jhoge123 said:
I would like to open an exit pop when a user leaves my site, but I
don't want to the back button to trigger the pop if the user remains
in my site.

God, I love my blocker software for IE and my option to turn off that
nonsense with Netscape and Opera.

Why in the world would you want to annoy people like that?
Either you're being irritating on purpose or you've coded something that
doesn't scale nicely and clean up after itself. Either way, stop that.
If your code is the problem, share. We can probably help you fix 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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top