数码资讯
js获取当前地址js获取当前URL的示例代码。
复制代码代码如下所示: thisurl = document.url; thishref = document.location.href; thissloc = self.location.href; thisdloc = document.location; strwrite =thisurl:
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
复制代码代码如下所示:
thisurl = document.url;
thishref = document.location.href;
thissloc = self.location.href;
thisdloc = document.location;
strwrite =thisurl:{+ thisurl +}
strwrite =thishref:+ thishref +}
strwrite =thissloc:+ thissloc +}
strwrite =thisdloc:+ thisdloc +}
document.write(strwrite);
thisdloc = document.location;
thisurl = document.url;
thishref = document.location.href;
thissloc = self.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);
thistloc = top.location.href;
thisploc = parent.document.location;
thisthost = top.location.hostname;
thishost = location.hostname;
tmphpage = thishref.split( / );
thishpage = tmphpage { tmphpage length-1 };
tmpupage = thisurl.split( / );
thisupage = tmpupage { tmpupage length-1 };
strwrite =thishpage:{+ thishpage +}
strwrite =thisupage:+ thisupage +}
document.write(strwrite);
thisurl = document.url;
thishref = document.location.href;
thissloc = self.location.href;
thisdloc = document.location;
strwrite =thisurl:{+ thisurl +}
strwrite =thishref:+ thishref +}
strwrite =thissloc:+ thissloc +}
strwrite =thisdloc:+ thisdloc +}
document.write(strwrite);
thisdloc = document.location;
thisurl = document.url;
thishref = document.location.href;
thissloc = self.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);
thistloc = top.location.href;
thisploc = parent.document.location;
thisthost = top.location.hostname;
thishost = location.hostname;
tmphpage = thishref.split( / );
thishpage = tmphpage { tmphpage length-1 };
tmpupage = thisurl.split( / );
thisupage = tmpupage { tmpupage length-1 };
strwrite =thishpage:{+ thishpage +}
strwrite =thisupage:+ thisupage +}
document.write(strwrite);
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。