Document.referrer - Web APIs 编辑
The Document.referrer
property returns the URI of the page that linked to this page.
Syntax
var referrer = document.referrer;
Value
The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark). Because this property returns only a string, it doesn't give you document object model (DOM) access to the referring page.
Inside an <iframe>
, the Document.referrer
will initially be set to the same value as the href
of the parent window's Window.location
.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'document.referrer' in that specification. | Living Standard |
Browser compatibility
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论