[Javascript] Another popup question

Gavin Cheyne gavcheyne at mac.com
Wed Sep 18 06:12:56 CDT 2002


Hi,

I've been asked alter a javascript popup so that it triggers when a user
leaves a particular area of the site. This will have to be triggered by
onUnload so that it appears even if the user jumps to another site.

I've got it working with onLoad thus:

    if (document.referrer.indexOf("my_directory") >= 0)
        {
           window.open("url", etc);
        }

My question is this: can I grab the url that the browser is going to, rather
than the one its coming from?

I suspect it is something simple, but I've had my nose in (beginners)
javascript books for days with no joy. Any help gratefully received.

Gavin.




More information about the Javascript mailing list