ITeye博客

JavaScript:referrer property

ilusm · 2008-08-25 10:32 · JavaScript · Markdown

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
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。