URL.protocol
La propriété protocol de l'interface URL est une USVString représentant le schéma protocolaire de URL, incluant ':' à la fin.
Note: Cette fonctionnalité est disponible via les Web Workers
Syntaxe
js
string = object.protocol;
object.protocol = string;
Valeur
Un USVString.
Exemples
js
var url = new URL('https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol');
var result = url.protocol; // Retourne:"https:"
Spécifications
| Specification |
|---|
| URL Standard # dom-url-protocol |
Compatibilité des navigateurs
BCD tables only load in the browser
Voir aussi
- L'interface
URLdont il est contenu.