`
ilusm
  • 浏览: 107782 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

JavaScript:referrer property

阅读更多


  • referrer property

    Specifies the URL of the calling document when a user clicks a link.

    语法
    document.referrer
      

    Property of

    document

    描述

    When a user navigates to a destination document by clicking a link object on a source document, the referrer property contains the URL of the source document. Evaluate the referrer property from the destination document.

    referrer is a read-only property.

    例子

    In the following example, the getReferrer() function is called from the destination document. It returns the URL of the source document.

    function getReferrer() {
       return document.referrer
    }
    
    

     

  • 分享到:
    评论

    相关推荐

    Global site tag (gtag.js) - Google Analytics