js获取url协议、接口等信息



alert("location:"+window.location);

alert("href: "+window.location.href);

alert("protocol: "+window.location.protocol);

alert("host&port: "+window.location.host);

alert("port: "+window.location.port);

alert("hostname: "+window.location.hostname);

猜你喜欢

转载自blog.csdn.net/chcengyuyyy/article/details/51187568