document.referrer不检索新选项卡的值:Safari

时间:2013-05-21 19:49:24

标签: javascript tabs safari

以下是两个示例页面

第1页:

<html>
<title>Page 1</title>
<body>
This is page 1
<a href="page2.html">Click to go to page 2 </a>
</body>
</html>

第2页:

<html>
<title>Page 2</title>
<script>
function test() 
{
alert(document.referrer);      
}
</script>
<body onload="javascript:test();">
This is page 2
<a href="page1.html">Click to go to page 1 </a>
</body>
</html>

在safari中,当从Page1点击链接时,document.referrer似乎没有工作/保持值。

它在Mozilla中运行良好。

0 个答案:

没有答案