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

来源:互联网 发布:数据结构书与算法java 编辑:程序博客网 时间:2024/05/24 06:59


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);

0 0