I think document.referrer is only set when the page is originated from a link on the previous page, doing location.href/location.replace will result in an empty document.referrer

解决方案 »

  1.   

    那怎么取得呢?我想判断如果是从yeah域名转过来就自动关闭yeah的窗口,
    如果无法完成,直接访问也会弹一个窗口然后自动关闭,一闪
      

  2.   

    pass the current url along, for example (of course, if you are using location.href/location.replace(), you need to make changes):
    <script language="javascript">
    function document.onclick()
    {
      if (event.srcElement.tagName == "A")
      {
          event.srcElement.href += "?url="+location.href;
      }}
    </script>
      

  3.   

    yeah.net要是有这么好就好了。嘿嘿