js获取api的一系列API接口

window.location.host
document.domain(vue下会发生错误)

//全地址
window.location.href

补充:
获取当前域名信息
代码如下

thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;
strwrite = ” thisTLoc: [" + thisTLoc + "]”
strwrite += ” thisPLoc: [" + thisPLoc + "]”
strwrite += ” thisTHost: [" + thisTHost + "]”
strwrite += ” thisHost: [" + thisHost + "]”
document.write( strwrite );

标签: none

添加新评论