0

Simple scenario:

1) User is on Page A and clicks a link to Page B. 2) User arrives to Page B. 3) An external (hosted on another domain C) Javascript is called when the user is on Page B in this or similar fashion:

<script src="http://www.domainC.com/script.js" type="text/javascript"></script>

4) Is there any way for script.js to tell that the user came to Page B from Page A?

Thanks!

4

1 回答 1

2

远程脚本在 Page B 的上下文中执行,因此它可以访问其全局范围。

document.referrer
于 2012-10-21T22:50:40.660 回答