Location pathname 属性

定义和用法
pathname 属性是一个可读可写的字符串,可设置或返回当前 URL 的路径部分。
语法
location.pathname
浏览器支持
所有主要浏览器都支持 pathname 属性
实例
实例
返回当前URL的路径名:
<script>
document.write(location.pathname);
</script>
document.write(location.pathname);
</script>
以上实例输出结果:
/jquery/prop-loc-pathname.html
尝试一下 »

尊贵的董事大人
英文标题不为空时 视为本栏投稿
需要关键字 描述 英文标题