From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/fr/web/api/url/tojson/index.html | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 files/fr/web/api/url/tojson/index.html (limited to 'files/fr/web/api/url/tojson') diff --git a/files/fr/web/api/url/tojson/index.html b/files/fr/web/api/url/tojson/index.html new file mode 100644 index 0000000000..8c34a37e42 --- /dev/null +++ b/files/fr/web/api/url/tojson/index.html @@ -0,0 +1,57 @@ +--- +title: URL.toJSON() +slug: Web/API/URL/toJSON +tags: + - API + - Méthode + - Reference + - URL + - toJSON() +translation_of: Web/API/URL/toJSON +--- +
{{APIRef("URL API")}}
+ +

La méthode toJSON() de l'interface {{domxref("URL")}} retourne un {{domxref("USVString")}} contenant une version sérialisé de l'URL, même si dans la pratique, il semble avoir le même effet que {{domxref("URL.toString()")}}.

+ +

{{AvailableInWorkers}}

+ +

Syntax

+ +
json = url.toJSON();
+ +

Paramètres

+ +

Aucun.

+ +

Valeur retournée

+ +

A {{domxref("USVString")}}.

+ +

Exemples

+ +
const url = new URL("https://developer.mozilla.org/en-US/docs/Web/API/URL/toString");
+url.toJSON()
+
+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('URL', '#dom-url-tojson', 'toJSON()')}}{{Spec2('URL')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.URL.toJSON")}}

-- cgit v1.2.3-54-g00ecf