Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

which page will be loaded ?

Status
Not open for further replies.

Izzac

Programmer
Jan 26, 2001
20
CA
Hi,

How can I detect when a browser leaves my web site ?

With the onUnLoad event, i can know when a new page is loaded, but is it possible to know which page will be loaded ?

zac
 
it is possible, not with onunload, but only if the user clicks on a link.

this will probably only work in IE also...

but here is the concept.. if you want code.. i'll write it out later.

set a event handler for document.body.onclick

that handler will check the window.event.srcElement.tagName to see if it's a link. then, it can get the href properties, to see what page it is going to. there are a bunch of properties for the anchor element that can help you.. they can tell you the hostname and page that the href refers to..

check for some info. adam@aauser.com
 
thanks luciddream !

I wrote the code and this work fine in IE ! :)

There remains to me the case of Netscape! :/

zac
 
the code should work in NS6 prolly also... but, i have no idea about events in NS4.x adam@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top