Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

referrer property

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



p = object.referrer


Property values

Type: String

A String that specifies the URL of the referring document.

Standards information


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.

See also




© 2017 Microsoft