port
特性为
定位
接口是
USVString
containing the port number of the URL. If the URL does not contain an explicit port number, it will be set to
''
.
string = object.port; object.port = string;
// Let's an <a id="myAnchor" href="https://developer.mozilla.org:443/en-US/docs/Location.port"> element be in the document
var anchor = document.getElementByID("myAnchor");
var result = anchor.port; // Returns:'443'
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'Location.port' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
port
|
Chrome Yes | Edge 12 | Firefox 22 | IE Yes | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android 22 | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持