HTML DOM Document referrer property
- Previous page readyState
- Next page removeEventListener()
- Go back one level HTML DOM Documents
Definition and usage
referrer
The property returns the URL of the document loading the current document.
referrer
The property is read-only.
example
Returns the URL of the document that referred to this document:
document.referrer;
syntax
document.referrer
return value
type | description |
---|---|
string |
The URL of the document loading the current document. If the document is not opened via a link, an empty string is returned. |
browser support
document.referrer
is a feature of DOM Level 2 (2001).
All browsers support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 9-11 | Support | Support | Support | Support |
- Previous page readyState
- Next page removeEventListener()
- Go back one level HTML DOM Documents