Exit Popup Page

Discussion in 'Javascript' started by Alex Shi, Jul 10, 2003.

  1. Alex Shi

    Alex Shi Guest

    Hello,

    I need an Exit popup page that when a visitor is on leaving my site it
    will popup. With "onUnLoad" it can work in this way but it also does
    something more that I don't want. When a visitor click links to pages
    within my site the popup will also open. I don't want this. What I need
    is that only when a visitor is leaving my site but current page, the popup
    will open. Anyone have a solution for this please give me a hand.
    Thanks in advance!

    Alex Shi


    --
    ==================================================
    Cell Phone Batteries at 30-50%+ off retail prices!
    http://www.pocellular.com
    ==================================================
    Alex Shi, Jul 10, 2003
    #1
    1. Advertising

  2. Alex Shi

    Littleboy Guest

    Hi Alex

    I'm afraid i'm an incredible novice concerning Javascript..

    (tonight I succeeded adapting a simple script to create a script that
    centers a browser window onload, so I thought let's take a look at a
    javascript newsgroup)

    ... but I believe that a simple solution is to use an extra frame in your
    site where you put your "onUnload + popUp" script in. Make it 0 px high if
    you don't want to see it. Now if you make sure you don't use this frame for
    loading any links in, the popup message will only occur once when a visitor
    exits your site.

    Like I said, i'm not a javascriptor, therefor I try to come up with somewhat
    creative solutions ;)

    Greets

    Littleboy

    "Alex Shi" <> wrote in message
    news:gokPa.143$...
    > Hello,
    >
    > I need an Exit popup page that when a visitor is on leaving my site it
    > will popup. With "onUnLoad" it can work in this way but it also does
    > something more that I don't want. When a visitor click links to pages
    > within my site the popup will also open. I don't want this. What I need
    > is that only when a visitor is leaving my site but current page, the popup
    > will open. Anyone have a solution for this please give me a hand.
    > Thanks in advance!
    >
    > Alex Shi
    >
    >
    > --
    > ==================================================
    > Cell Phone Batteries at 30-50%+ off retail prices!
    > http://www.pocellular.com
    > ==================================================
    Littleboy, Jul 10, 2003
    #2
    1. Advertising

  3. Alex Shi

    JHLeong Guest

    "Littleboy" <littleboy@nydesign_nospam.dk> wrote in message news:<3f0debe3$0$13214$>...
    > Hi Alex
    >
    > I'm afraid i'm an incredible novice concerning Javascript..
    >
    > (tonight I succeeded adapting a simple script to create a script that
    > centers a browser window onload, so I thought let's take a look at a
    > javascript newsgroup)
    >
    > .. but I believe that a simple solution is to use an extra frame in your
    > site where you put your "onUnload + popUp" script in. Make it 0 px high if
    > you don't want to see it. Now if you make sure you don't use this frame for
    > loading any links in, the popup message will only occur once when a visitor
    > exits your site.
    >
    > Like I said, i'm not a javascriptor, therefor I try to come up with somewhat
    > creative solutions ;)
    >
    > Greets
    >
    > Littleboy
    >
    > "Alex Shi" <> wrote in message
    > news:gokPa.143$...
    > > Hello,
    > >
    > > I need an Exit popup page that when a visitor is on leaving my site it
    > > will popup. With "onUnLoad" it can work in this way but it also does
    > > something more that I don't want. When a visitor click links to pages
    > > within my site the popup will also open. I don't want this. What I need
    > > is that only when a visitor is leaving my site but current page, the popup
    > > will open. Anyone have a solution for this please give me a hand.
    > > Thanks in advance!
    > >
    > > Alex Shi
    > >
    > >
    > > --
    > > ==================================================
    > > Cell Phone Batteries at 30-50%+ off retail prices!
    > > http://www.pocellular.com
    > > ==================================================


    something like this:

    <html>
    <head>
    <script type='text/javascript'>
    var closing = true;
    </script>
    </head>
    <body onunload="if(closing){popupClosing();}">
    <a href='xxx.html' onclick="closing = false;document.location.href =
    this.href;return false;">link</a>
    </body>
    </html>
    JHLeong, Jul 11, 2003
    #3
  4. Alex Shi

    Littleboy Guest

    Hm.. interestting y'all ;)

    Will try!

    Littleboy

    "Littleboy" <littleboy@nydesign_nospam.dk> wrote in message
    news:3f0debe3$0$13214$...
    > Hi Alex
    >
    > I'm afraid i'm an incredible novice concerning Javascript..
    >
    > (tonight I succeeded adapting a simple script to create a script that
    > centers a browser window onload, so I thought let's take a look at a
    > javascript newsgroup)
    >
    > .. but I believe that a simple solution is to use an extra frame in your
    > site where you put your "onUnload + popUp" script in. Make it 0 px high if
    > you don't want to see it. Now if you make sure you don't use this frame

    for
    > loading any links in, the popup message will only occur once when a

    visitor
    > exits your site.
    >
    > Like I said, i'm not a javascriptor, therefor I try to come up with

    somewhat
    > creative solutions ;)
    >
    > Greets
    >
    > Littleboy
    >
    > "Alex Shi" <> wrote in message
    > news:gokPa.143$...
    > > Hello,
    > >
    > > I need an Exit popup page that when a visitor is on leaving my site it
    > > will popup. With "onUnLoad" it can work in this way but it also does
    > > something more that I don't want. When a visitor click links to pages
    > > within my site the popup will also open. I don't want this. What I need
    > > is that only when a visitor is leaving my site but current page, the

    popup
    > > will open. Anyone have a solution for this please give me a hand.
    > > Thanks in advance!
    > >
    > > Alex Shi
    > >
    > >
    > > --
    > > ==================================================
    > > Cell Phone Batteries at 30-50%+ off retail prices!
    > > http://www.pocellular.com
    > > ==================================================

    >
    >
    Littleboy, Jul 11, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FuZHk=?=

    Code to Exit Web App and Exit Internet Explorer

    =?Utf-8?B?U2FuZHk=?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    7,895
    =?Utf-8?B?U2FuZHk=?=
    Aug 5, 2005
  2. Joe Smith
    Replies:
    4
    Views:
    65,836
    sandeep1976
    Nov 8, 2006
  3. Replies:
    2
    Views:
    452
    Jeff Epler
    May 31, 2005
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    518
    Randy Webb
    Jun 19, 2004
  5. Replies:
    2
    Views:
    460
Loading...

Share This Page