aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/window/url/index.html
blob: 6ca15914a4b80643f5e9ce2554fd44c2bc780f6b (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
96
97
98
99
100
101
102
---
title: Window.URL
slug: Web/API/Window/URL
tags:
  - API
  - DOM
  - Propiedad
  - Referencia
  - Referência DOM
  - WebAPI
translation_of: Web/API/URL
translation_of_original: Web/API/Window/URL
---
<p>{{ApiRef("Window")}}{{SeeCompatTable}}</p>

<p>La propiedad <strong><code>Window.URL</code></strong> devuelve un objeto que proporciona métodos estáticos usados para crear y gestionar objetos de URLs. Además puede ser llamado como un constructor para construir objetos {{domxref("URL")}}.</p>

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

<h2 id="Sintaxis">Sintaxis</h2>

<p>Llamando a un método estático:</p>

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

<p>Construyendo un nuevo objeto:</p>

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

<h2 id="Especificación">Especificación</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Especificación</th>
   <th scope="col">Estado</th>
   <th scope="col">Comentario</th>
  </tr>
  <tr>
   <td>{{SpecName('URL', '#dom-url', 'URL')}}</td>
   <td>{{Spec2('URL')}}</td>
   <td>Definición inicial</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2>

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

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Característica</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Soporte básico</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>Característica</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Soporte básico</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] Desde Gecko 2 (Firefox 4) hasta Gecko 18 incluidos, Gecko devuelve un objeto con el tipo interno no estandar <code>nsIDOMMozURLProperty</code>. En la práctica, esto no hace ninguna diferencia.</p>

<p>[2] Implementado bajo el nombre no estandar <code>webkitURL</code>.</p>