[thelist] Pop-up when user leaves site.

Dave Hinton catbells at pat.mkn.co.uk
Mon May 21 09:32:00 CDT 2001

> >I want to have a pop-up window come up when a user leaves my website.
> >I have found several scripts that work when a user leaves a "page",
> >but I
> >only want the pop-up to come up when they leave the "site".
> >
> >Know what I mean?

Peter-Paul Koch wrote:
> In practice this can't be done, because you cannot find out if the new
> page is from a new site. If the page is in another site you're not
> allowed to read out the location, so you cannot tell the location of
> the new page.

You could use a frameset, with a single frame.  Staying on your site
would keep you in your frameset.  Going to a different site would lose
the frameset, in which your onunload can fire.

Of course, this means people can't bookmark any of the pages on your
site (apart from the first one).  And they'll have trouble linking to
you as well (except to the front page).

  //  Dave Hinton
=()=  Web Developer, MarketNet
//    London 7691 8968

More information about the thelist mailing list