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);
本文详细解析了JavaScript中获取网页URL各组成部分的方法,包括location对象的使用及属性解析,帮助开发者深入理解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);
546
4614
2387
1439

被折叠的 条评论
为什么被折叠?
