HTML DOM Document referrer
Definition and Usage
The referrer
property returns the URL of the document that loaded the current document.
The referrer
property is read-only.
Syntax
document.referrer
Return Value
Type | Description |
String | The URL of the document that loaded the current document. If the document was not opened with a link, an empty string is returned. |
Browser Support
document.referrer
is a DOM Level 2 (2001) feature.
It is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 9-11 |