The pathname
property sets or returns the pathname of a URL (page).
Return the pathname property:
location.pathname
Set the pathname property:
location.pathname =
path
Parameter | Description |
path | The pathname of the URL. |
Type | Description |
A string | The current pathname. |
location.pathname
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!