View Single Post
Old 07-22-2004, 12:15 PM   PM User | #3
glenngv
Elite Coder
 
Join Date: Jun 2002
Location: Virginia, USA Original Location: Philippines
Posts: 8,809
glenngv is an unknown quantity at this point
You can use document.referrer to get the referring page or get it in the server-side but that's not reliable. Another alternative is to set the window.name property from website A then check it in website B. That property is persistent accross windows regardless of domain.

website A:
Code:
var marker = "websiteBreferrer:";
window.name = marker+location.href;
alert(window.name);
website B:
Code:
alert(window.name);
var marker = "websiteBreferrer:";
if (window.name.indexOf(marker)==0){ //make sure it's the first string
  alert("The user came from "+window.name.substring(marker.length));
   //...
}
The caveat of this is if javascript is disabled, you won't be able to track it and NS4 doesn't allow invalid characters in window.name.

Last edited by glenngv : 07-22-2004 at 12:18 PM.
glenngv is offline   Reply With Quote