Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM referrer property

HTML DOM referrer property

Document Object Reference Document Object


Definition and Usage

The referrer property returns the URL of the document from which the current document was loaded.

If the current document was not accessed through a hyperlink, it is null. This property allows client-side JavaScript to access the HTTP referer header.

Syntax

document.referrer


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the referrer property


Example

Example

Return the source URL of the current document:

The referrer URL of this document:

Try it »


Document Object Reference Document Object