URL.toJSON()
La méthode toJSON()
de l'interface URL
retourne un USVString
contenant une version sérialisé de l'URL, même si dans la pratique, il semble avoir le même effet que URL.toString()
.
Note: Cette fonctionnalité est disponible via les Web Workers
Syntax
json = url.toJSON();
Paramètres
Aucun.
Valeur retournée
A USVString
.
Exemples
const url = new URL("https://developer.mozilla.org/en-US/docs/Web/API/URL/toString"); url.toJSON()
Spécifications
Spécification | Statut | Commentaire |
---|---|---|
URL La définition de 'toJSON()' dans cette spécification. |
Standard évolutif | Définition initiale. |
Compatibilité des navigateurs
BCD tables only load in the browser