Home  >  Article  >  Web Front-end  >  javascript document.referrer 用法_javascript技巧

javascript document.referrer 用法_javascript技巧

WBOY
WBOYOriginal
2016-05-16 18:53:321100browse

举例:
1. a.html文件内容如下:
浏览b.html
2. b.html文件中的内容如下:





3. 则在通过a.html中的超链接访问b.html的时候,显示的结果是:
http://127.0.0.1:8180/a.html

说明:

经过测试,需要将两个文件放在服务器中才能得到想要的结果,若直接在本地文件夹中则得到空字符串,若直接在浏览器地址栏中输入b.html的URL地址或使用打开菜单访问b.html,则document.referrer的值为空字符串。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn