aboutsummaryrefslogtreecommitdiff
path: root/files/fr/conflicting/web/api/url/index.html
blob: 223701977c13becbcaae64e517d8f6132f21132d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
title: Window.URL
slug: Web/API/Window/URL
translation_of: Web/API/URL
translation_of_original: Web/API/Window/URL
---
<p>{{ApiRef("Window")}}{{SeeCompatTable}}</p>

<p>La propriété <strong><code>Window.URL</code></strong> retourne un objet qui fournit les méthodes statiques utilisées pour créer et gérer les objets URLs. On peut aussi l'appeler comme uns constructeur pour instancier des objets {{domxref("URL")}}.</p>

<p>{{AvailableInWorkers}}</p>

<h2 id="Syntax">Syntax</h2>

<p>Utilisation de la méthode statique:</p>

<pre class="syntaxbox"><code><var>img</var>.src = URL.{{domxref("URL.createObjectURL", "createObjectURL")}}(<var>blob</var>);</code></pre>

<p>Utilisation d'un objet instancié:</p>

<pre class="syntaxbox"><code>var <var>url</var> = new {{domxref("URL.URL", "URL")}}("../cats/", "https://www.example.com/dogs/");</code></pre>

<h2 id="Specification">Specification</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('URL', '#dom-url', 'URL')}}</td>
   <td>{{Spec2('URL')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>8.0<sup>[2]</sup></td>
   <td>{{CompatGeckoDesktop("2.0")}}<sup>[1]</sup><br>
    {{CompatGeckoDesktop("19.0")}}</td>
   <td>10.0</td>
   <td>15.0<sup>[2]</sup></td>
   <td>6.0<sup>[2]</sup><br>
    7.0</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}<sup>[2]</sup></td>
   <td>{{CompatGeckoMobile("14.0")}}<sup>[1]</sup><br>
    {{CompatGeckoMobile("19.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>15.0<sup>[2]</sup></td>
   <td>6.0<sup>[2]</sup></td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] From Gecko 2 (Firefox 4) to Gecko 18 included, Gecko returned an object with the non-standard <code>nsIDOMMozURLProperty</code> internal type. In practice, this didn't make any difference.</p>

<p>[2] Implemented under the non-standard name <code>webkitURL</code>.</p>