The protocol property sets or returns the protocol of the current URL, including the colon (:).
The protocol is a standard that specifies how data are transmitted between computers.
Return the protocol property:
location.protocol
Set the protocol property:
location.protocol =
protocol
Parameter | Description |
protocol | The protocol of the URL. Examples:
|
Type | Description |
A string | The protocol of the current URL, including the colon (:) |
location.protocol
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!