Location port 属性
定义和用法
port 属性设置或返回服务器用于URL的端口号。
注释: 如果没有指定端口号,端口号就是80或443(这是默认的端口号)。
浏览器支持
| 属性 | |||||
|---|---|---|---|---|---|
| port | Yes | Yes | Yes | Yes | Yes |
语法
返回 port 属性:
location.port
设置 port 属性:
location.port = port
属性值
| 值 | 类型 | 描述 |
|---|---|---|
| port | String | Specifies the port number of the URL |
技术细节
| 返回值: | 字符串, representing the port number of a URL. 注释: If the port number is not specified or if it is the scheme's default port (like 80 or 443), an empty string is returned |
|---|
❮ Location 对象
