使用location.pathname属性返回URL的路径名
导读:Window Location Pathname location.pathname 属性返回 URL 的路径名。 实例 返回当前 URL 的路径名: document.write(location.pathname ;...
Window Location Pathname
location.pathname 属性返回 URL 的路径名。
实例
返回当前 URL 的路径名:
document.write(location.pathname);
以上代码输出为:
/js/js-window-location.html
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: 使用location.pathname属性返回URL的路径名
本文地址: https://pptw.com/jishu/655639.html
