URL.toString()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since avril 2018.
La méthode URL.toString() retourne un USVString contenant tout l'URL. C'est en effet, une version de URL.href 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://newreal1.mobosoft.fun/fr/docs/Web/API/URL/toString",
);
url.toString(); // doit retourner l'URL en tant que chaîne
Spécifications
| Specification |
|---|
| URL> # URL-stringification-behavior> |
Compatibilité des navigateurs
Loading…
Voir aussi
- L'interface
URLà laquelle elle appartient.