美文网首页
JS原生location对象

JS原生location对象

作者: 简不简单_都好 | 来源:发表于2017-07-23 15:57 被阅读11次

    假设当前 url 是 http://192.168.31.194:8000/jquery/index.html?a=3&c=aa#b

    location.href // 完整的url
    location.hostname // 192.168.31.194
    location.host // 192.168.31.194:8000
    location.port // 8000
    location.protocol // http:
    location.search // ?a=3&c=aa
    location.hash // #b
    location.pathname // /jquery/index.html
    

    相关文章

      网友评论

          本文标题:JS原生location对象

          本文链接:https://www.haomeiwen.com/subject/zsjmkxtx.html