referrer property
Specifies the URL of the calling document when a user clicks a link.
语法
document.referrer
Property of
document
描述
When a user navigates to a destination document by clicking a link object on a source document, the referrer property contains the URL of the source document. Evaluate the referrer property from the destination document.
referrer is a read-only property.
例子
In the following example, the getReferrer() function is called from the destination document. It returns the URL of the source document.
function getReferrer() { return document.referrer }