定义和用法
该路径属性设置或返回URL的路径名。
浏览器支持
属性 | |||||
---|---|---|---|---|---|
pathname | 是 | 是 | 是 | 是 | 是 |
句法
返回的路径属性:
location.pathname
设置路径属性:
location.pathname= path
属性值
Value | Type | Description |
---|---|---|
path | String | Specifies the pathname of the URL |
技术细节
返回值: | 一个字符串,代表路径 |
---|

该路径属性设置或返回URL的路径名。
属性 | |||||
---|---|---|---|---|---|
pathname | 是 | 是 | 是 | 是 | 是 |
返回的路径属性:
location.pathname
设置路径属性:
location.pathname= path
Value | Type | Description |
---|---|---|
path | String | Specifies the pathname of the URL |
返回值: | 一个字符串,代表路径 |
---|