Location pathname 属性

定义和用法
pathname 属性是一个可读可写的字符串,可设置或返回当前 URL 的路径部分。
语法
location.pathname
浏览器支持
所有主要浏览器都支持 pathname 属性
实例
返回当前URL的路径名:
<script> document.write(location.pathname); </script>

pathname 属性是一个可读可写的字符串,可设置或返回当前 URL 的路径部分。
location.pathname
所有主要浏览器都支持 pathname 属性
返回当前URL的路径名:
<script> document.write(location.pathname); </script>