URL.toString()
La méthode URL.toString() retourne un USVString contenant tout l'URL. C'est en effet, une version de URL.href (en-US) en lecture seule.
Note: Cette fonctionnalité est disponible via les Web Workers
Syntaxe
js
string = url.toString();
Paramètres
Aucun.
Valeur de retour
Un USVString.
Examples
js
const url = new URL("https://developer.mozilla.org/en-US/docs/Web/API/URL/toString");
url.toString() // doit retourner l'URL en tant que chaîne
Spécifications
| Specification |
|---|
| URL Standard # URL-stringification-behavior |
Compatibilité des navigateurs
BCD tables only load in the browser
Voir aussi
- L'interface
URLà laquelle elle appartient.