Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: pop up window

  1. #1
    New Coder
    Join Date
    Sep 2005
    Thanked 0 Times in 0 Posts

    pop up window

    Hello all,

    I have been asked to create a (annoying) pop up window on a site, that only is displayed after a user has left the site, by either closing the browser window or by leaving the site to go to another URL. Is this possible?

    And if it is, could anyone offer advice or script on how to go about this?

    Thanks guys,


  2. #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Near Chicago, IL, USA
    Thanked 32 Times in 31 Posts
    It is possible to try using a combo of intrasite links set up just so (so you can check if the user is leaving the site) and the window onunload event.

    Most blockers catch this crap these days, though.

    MSIE has a few vbscript hacks to be even more annoying, but WinXP SP2 has fixed most issues that allowed such nonsense.

    I won't go into more detail than this on a public forum.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts