Forum Moderators: open
I've heard that this is a fairly simple thing to accomplish, but am stuck as to how to proceed. Basically, I want a JavaScript function to run if the user accessed the page via a link on any page from the same domain.
For example, if my site is example.com, and a user clicks on a link leading to example.com from example.com/links.html - there would be a piece of JavaScript on example.com that would distinguish a user who visited from any page on the example.com domain (such as links.html) between someone who visited it from, say, Google, that would look something like this (obviously substituting in words for the missing part I don't know how to accomplish):
if (link referral location = mydomain.com)
{
document.write('You arrived at this page from a link on this same site!');
}
Help would be greatly appreciated - thanks in advance! :)
[edited by: SomePerson6 at 12:45 am (utc) on Oct. 23, 2008]