port
特性为
URL
接口是
USVString
containing the port number of the URL. If the URL does not contain an explicit port number, it will be set to
''
.
const portNumber = url.port url.port = newPortNumber
A
USVString
.
const url = new URL('');
console.log(url.port); // Logs '80'
| 规范 | 状态 | 注释 |
|---|---|---|
|
URL
The definition of 'URL.port' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
port
|
Chrome Yes | Edge 13 | Firefox 22 | IE No | Opera Yes | Safari 10 | WebView Android Yes | Chrome Android Yes | Firefox Android 22 | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
不支持
URL
interface it belongs to.