Home > Web Front-end > JS Tutorial > body text

javascript document.referrer 用法_javascript技巧

WBOY
Release: 2016-05-16 18:53:32
Original
1099 people have browsed it

举例:
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的值为空字符串。
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!