Window location.protocol 属性
- Previous page port
- Next page reload()
- Go up one level Window Location
定义和用法
protocol
属性设置或返回当前 URL 的协议,包括冒号 (:)。
该协议是一种标准,用于指定数据在计算机之间的传输方式。
语法
返回 protocol 属性:
location.protocol
设置 protocol 属性:
location.protocol = protocol
属性值
值 | 描述 |
---|---|
protocol | URL 的协议。例如: |
返回值
类型 | 描述 |
---|---|
String | The protocol of the current URL, including the colon (:). |
Browser support
All browsers support location.protocol:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous page port
- Next page reload()
- Go up one level Window Location