HTML DOM referrer property
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





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