Forum Moderators: open

Message Too Old, No Replies

Exit message

Message window on exit

         

Adam5000

12:26 pm on Sep 27, 2007 (gmt 0)

10+ Year Member



When surfers leave my site, I'd like to give them an exit message. For example, if a person clicks on a link to Google a message would appear "You have now left my site." with a button to click to continue to Google or automatically continue after a few seconds.

But I only want this message to appear when they leave my site. Going from page to page within the site doesn't count.

Right now I'm thinking something like the onload command only at the exit. But again, going from page to page doesn't count. I only want the message to appear when the surfers leave my site.

Help!

piatkow

1:28 pm on Sep 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Unless there is some direct benefit for the user I doubt if it is worthwhile. Messages like that always seem a bit naff and generally put me off returning to a site.

If there really is a need for this then, with some fairly simple coding, you should be able link to your warning page and pass the address of the target page as a parameter.

I would never force a message on a visitor who left with the back button or via a bookmark.

vincevincevince

1:36 pm on Sep 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Javascript sounds like the best solution. onLoad, go through the DOM looking for A elements, and add an onClick handler.

Xapti

11:30 pm on Sep 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



People dislike such functions, and it has no benefit to you or them whatsoever. I highly recommend you do not implement such a thing.

The best thing you could do (depending what your goal was), is to tag in some way (either with little icons beside them, different background color, a little div which appears under it when hovered, etc) links which will leave your site.
This can be done quite easily with a css attribute selector, something I don't think IE6 supports though.