3 out of 7 rated this helpful - Rate this topic

referrer property

[This documentation is preliminary and is subject to change.]

Gets the URL of the location that referred the user to the current document.

Syntax

JavaScript

p = object.referrer

Property values

Type: String

A String that specifies the URL of the referring document.

Standards information

Remarks

This property returns a value only when the user reaches the current document through a link from the previous document. Otherwise, document.referrer returns an empty string; it also returns an empty string when the link is from a secure site.

For example, if DocumentA.htm includes a link to DocumentB.htm, and the user clicks that link, the document.referrer on DocumentB.htm returns "DocumentA.htm." However, if the user is on DocumentA.htm and types DocumentB.htm into the address line or chooses the Open command from the File menu to get to DocumentB.htm, the document.referrer returns an empty string.

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Flash content
document.referrer is also empty when the user clicked on a link in a flash file.