pathname
特性为
URL
接口是
USVString
包含初始
'/'
followed by the path of the URL (or the empty string if there is no path).
const path = url.pathname url.pathname = newPath
A
USVString
.
const url = new URL('../API/URL/pathname?q=value');
console.log(url.pathname); // Logs "/en-US/docs/Web/API/URL/pathname"
| 规范 | 状态 | 注释 |
|---|---|---|
|
URL
The definition of 'URL.pathname' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
pathname
|
Chrome Yes | Edge 13 |
Firefox
53
|
IE No | Opera Yes | Safari 10 | WebView Android Yes | Chrome Android Yes |
Firefox Android
53
|
Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
不支持
见实现注意事项。
URL
interface it belongs to.