Showing
the pop-up when your visitor is
exiting your page
This
script will show you how to do an 'Exit-Popup'.
For
instance, let's say that your exit-pop-up code
is on your home page.
When a visitor arrives at your home page, and
then clicks over to another link
on your web site, or even a totally different
site - that's when the popup will be
popped-up. that,
let me quickly tell you why an entry-popup on
your
home page may not be such a good idea:
When
you use an exit-popup, the loading of your home
page is
not affected by the pop-up, because it pop-ups
only when your
visitor leaves your home page.
So,
if you used an exit-popup (in Javascript parlance,
an onUnload() event),
the popup will open:
a. if the browser window is closed,
b. if the visitor moves to another page on your
site,
c. if the visitor goes to a totally different
site
To
see a onUnload() popup, go to my page at
http://www.BabyNamesIndia.com and then click away
to a
different site, to a different page or simply
close that
window.
Cookie
Tracking
This
script makes use of cookie-tracking to make sure
that
the pop-up does not pop-up every single time your
visitor leaves
your home page. So, basically, what this means
is, that your
pop-up will be shown to your visitor only
once per visit (once per
browser session), thus avoiding showing him the
same pop-up
again and again which could really irritate your
visitor to such an
extent that they may never come back to your
site again, let alone
buy your product!
Try
a Demo:
Demo
not available
Part
I: JavaScript Code for the pop-up
Cut and paste the following code anywhere between
the
following two tags within your HTML code: <HEAD>
& </HEAD>
Function
variables:
Read the following code carefully:
CODE
REMOVED
|