Click to Rate and Give Feedback
Properties
 referrer Property
referrer Property

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

Syntax

[ sUrl = ] document.referrer

Possible Values

sUrl A String that specifies the URL of the referring page.

The property is read-only. The property has no default value.

Remarks

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

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

Standards Information

This property is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

document
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker