aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/url/tojson/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/api/url/tojson/index.html')
-rw-r--r--files/fr/web/api/url/tojson/index.html57
1 files changed, 57 insertions, 0 deletions
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
+---
+<div>{{APIRef("URL API")}}</div>
+
+<p>La méthode <strong><code>toJSON()</code></strong> 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()")}}.</p>
+
+<p>{{AvailableInWorkers}}</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">json = url.toJSON();</pre>
+
+<h3 id="Paramètres">Paramètres</h3>
+
+<p>Aucun.</p>
+
+<h3 id="Valeur_retournée">Valeur retournée</h3>
+
+<p>A {{domxref("USVString")}}.</p>
+
+<h2 id="Exemples">Exemples</h2>
+
+<pre><span class="message-body-wrapper"><span class="message-flex-body"><span class="devtools-monospace message-body"><span class="cm-keyword">const</span> <span class="cm-def">url</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">URL</span>(<span class="cm-string">"https://developer.mozilla.org/en-US/docs/Web/API/URL/toString"</span>);
+<span class="cm-variable">url</span>.<span class="cm-property">toJSON</span>()</span></span></span>
+</pre>
+
+<h2 id="Spécifications">Spécifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">Statut</th>
+ <th scope="col">Commentaire</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('URL', '#dom-url-tojson', 'toJSON()')}}</td>
+ <td>{{Spec2('URL')}}</td>
+ <td>Définition initiale.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+
+
+<p>{{Compat("api.URL.toJSON")}}</p>