Example:
1. The content of the a.html file is as follows:
Browse b.html
2. The content of the b.html file is as follows:
3. When accessing b.html through the hyperlink in a.html, the displayed result is:
http://127.0.0.1: 8180/a.html
Note:
After testing, you need to put the two files in the server to get the desired results. If you put them directly in the local folder, you will get an empty string. , if you directly enter the URL address of b.html in the browser address bar or use the open menu to access b.html, the value of document.referrer is an empty string.