js获取当前页面链接和userAgent

180it 2020-02-16 AM 2515℃ 0条

var ua = navigator.userAgent.toLowerCase();
var baseUrl=window.location.protocol+"//"+window.location.hostname+'/?'+new Date().getTime();

document.writeln("userAgent:"+ua);
document.writeln("<br/>baseUrl:"+baseUrl);

结果:
userAgent:mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/78.0.3904.108 safari/537.36
baseUrl:http://result.xxx.top/?1581821762269

支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

js获取当前页面链接和userAgent