Does document.referrer equal the HTTP referer header?
问题 If I follow a normal link from http://google.com to http://example.com, normally the http referrer header that my browser sends to example.com is of google.com. Is that header's value always the same as the value of document.referrer inside the example.com page? 回答1: The referer sent by the client in the request header is the same as document.referrer available in JavaScript. However, you can't rely that the referrer information would always be available. It's up to the client to send the