美文网首页
JavaScript获取web域名

JavaScript获取web域名

作者: ForeverYoung_06 | 来源:发表于2019-10-25 10:13 被阅读0次
    console.log(window.location.hostname)//web主机域名
    console.log(window.location.pathname)//当前页面路径及文件名
    console.log(window.location.port)//web主机端口
    console.log(window.location.protocal)//所使用的web协议

相关文章

网友评论

      本文标题:JavaScript获取web域名

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