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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

History/previous page

Status
Not open for further replies.

sarak

Programmer
May 3, 2001
25
US
I'd like to use javascript to determine if a visitor arrived at my website via a specific link (from another website that I have no control over). I've had no problem creating a "back" link that takes a visitor one step back in the history array (so the info is stored somewhere). However, I've been unsuccessful in extracting this information from the history array in order to compare it to the link. Is this possible? Maybe I'm running into privacy issues...?

(I apologize in advance if this question has already been answered. Since the search function for Tek-Tips isn't working I wasn't able to check.)
 
pass a querystring along witht he link that is clicked so you can tell the origin
as in
link is page.htm use "page.htm?here=thislink"

then you can parse the url in the second page to get the information for the url with a few indexOf's and split's

_______________________________________________
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
has you're questio
 
Thanks for the response. Unfortunately I don't have control over the exact link the other website uses to get to our home page. So, if their link to my site is simply is there a way - using a script on my home page - to find out where the vistor came from? I'd only need to know the previous page they were at.
 
I think you use the indexOf function
I cant find the exact syntax
Normally this is done in VBScript or PHP
Do you want the code for that?
What script are you using on the server side?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top