Venster locatie.protocol
Voorbeeld
Retourneer het protocol van de huidige URL:
let protocol = location.protocol;
Definitie en gebruik
Met de eigenschap protocol wordt het protocol van de huidige URL ingesteld of geretourneerd, inclusief de dubbele punt (:).
Het protocol is een standaard die specificeert hoe gegevens tussen computers worden verzonden.
Syntaxis
Retourneer de protocoleigenschap:
location.protocol
Stel de protocoleigenschap in:
location.protocol = protocol
Eigendoms-waarde
Parameter | Description |
protocol |
The protocol of the URL. Examples:
|
Winstwaarde
Type | Beschrijving |
Een draad | Het protocol van de huidige URL, inclusief de dubbele punt (:) |
Browserondersteuning
location.protocol
wordt ondersteund in alle browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |