referrer Property--------------------------------------------------------------------------------Retrieves the URL of the location that referred the user to the current page.SyntaxHTML N/A 
Scripting [ sUrl = ] document.referrer Possible ValuessUrl String爐hat specifies the URL of the referring page. The property is read-only. The property has no default value.Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.ResThis property returns a value only when the user reaches the current page through a link from the previous page. Otherwise, document.referrer returns an empty string; it also returns an empty string when the link is from a secure site.For example, if PageA.htm includes a link to PageB.htm, and the user clicks that link, the document.referrer on PageB.htm returns "PageA.htm". However, if the user is on PageA.htm and types PageB.htm into the address line or uses Open in the File menu to get to PageB.htm, the document.referrer returns an empty string.

解决方案 »

  1.   

    不行就用window.location.href试试
    或者window.navigate("url")
      

  2.   

    document.referrer
    必须通过http协议使用。
    也就是说,你必须上传页面到空间后,用http://xxx/的方式访问才行
      

  3.   

    location.href跳转的取不到referrer
      

  4.   

    我做了2个页面,1.asp 、2.asp,在1页面里用window.location跳转到2页面里,都可以得到1页面的地址,可为什么在这里就不行?
      

  5.   

    document.referrer
    必须通过http协议使用。
    也就是说,你必须上传页面到空间后,用http://xxx/的方式访问才行
    并且referrer是通过<a>链接调用的才能取到。(如在a.htm中通过链接<a href="b.htm"></a>
    进入b.htm,那么在b.htm中有document.referrer时就会取到上一页的URL。
    你试试用window.history.go(-1);吧