Website Scripts And Cloud Tutorials

HTTP referrer using Javascript

Byadmin

Aug 22, 2010

Last updated on May 20th, 2016 at 03:45 pm

Click to rate this tutorial!
[Total: 8 Average: 4]

HTTP referrer using Javascript

This is another simple script to get the HTTP referrer using javascript. It will help you in getting the referrer, The page from which your current web page got loaded. Use JavaScript’s referrer property to find out where your visitor came from.

<script LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> 
<!-- Hide script from old browsers
	if (document.referrer != '') 
   	alert('This webpage was referred from ' + document.referrer); 
//-- Stop hiding script --> 
</script> 

As you can see we are using document.referrer which is one of the Javascript useful properties that gives you the URI of the page linked to the current page.

Click to rate this tutorial!
[Total: 8 Average: 4]

Leave a Reply

Your email address will not be published.