View Full Version : Detect when user browser goes to another web site

01-14-2007, 01:02 PM
Hello folks,
Is there any way that an Apache server can recognise that a users browser has changed from your web site to another site. ie. is there a way of executing a CGI based on when the address bar no longer has your FDQN.
Would this be via Javascript [if possible?] or ???

Sorry for this naive question):


01-14-2007, 06:58 PM
Depending on how the visitor has their browser and firewall configured the site they have reached might be able to identify that they came from your site or it might not. The code to test for it would have to be on the site that they go to though because once they leave your site you have no way to run anything.

01-14-2007, 10:41 PM
You could have an onunload event listener to do something when window.location.href changes. You would have to disable that event listener when a link to somewhere else on your site is clicked. It's not a perfect solution (it will not handle manual changes of window.location.href) but it may be sufficient for your situation.

01-16-2007, 03:36 PM
Thanks for your replies. I'll have to give it up unfortunately.