blob: e6ef3fe5cd1752de94c389ac90a5065a5d5a5aac (
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
---
title: WindowOrWorkerGlobalScope.indexedDB
slug: Web/API/WindowOrWorkerGlobalScope/indexedDB
translation_of: Web/API/WindowOrWorkerGlobalScope/indexedDB
---
<p>{{ APIRef() }}</p>
<p>La propiedad <strong><code>indexedDB</code></strong> del mixin {{domxref("WindowOrWorkerGlobalScope")}} proporciona un mecanismo para que las aplicaciones puedan acceder asíncronamente a las capacidades de las bases de datos indexadas.</p>
<h2 id="Sintaxis">Sintaxis</h2>
<pre class="brush: js">var DBOpenRequest = self.indexedDB.open('toDoList');</pre>
<h3 id="Valor">Valor</h3>
<p>Un objeto {{domxref("IDBFactory")}}.</p>
<h2 id="Ejemplo">Ejemplo</h2>
<pre class="brush: js;highlight:[3]">var db;
function openDB() {
var DBOpenRequest = window.indexedDB.open('toDoList');
DBOpenRequest.onsuccess = function(e) {
db = DBOpenRequest.result;
}
}</pre>
<h2 id="Especificaciones">Especificaciones</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('IndexedDB 2', '#dom-windoworworkerglobalscope-indexeddb', 'indexedDB')}}</td>
<td>{{Spec2('IndexedDB 2')}}</td>
<td>Definido en un <code>WindowOrWorkerGlobalScope</code> parcial en la última especificación.</td>
</tr>
<tr>
<td>{{SpecName('IndexedDB', '#widl-IDBEnvironment-indexedDB', 'indexedDB')}}</td>
<td>{{Spec2('IndexedDB')}}</td>
<td>Definición inicial.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">Compatibilidad de Navegadores</h2>
<div>{{CompatibilityTable}}</div>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Característica</th>
<th>Chrome</th>
<th>Edge</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari (WebKit)</th>
</tr>
<tr>
<td>Soporte básico</td>
<td>23{{property_prefix("webkit")}}<br>
24</td>
<td>{{CompatVersionUnknown}}</td>
<td>10 {{property_prefix("moz")}}<br>
{{CompatGeckoDesktop("16.0")}}<br>
{{CompatGeckoDesktop("52.0")}}<sup>[1]</sup></td>
<td>10, parcial</td>
<td>15</td>
<td>7.1</td>
</tr>
<tr>
<td>Disponible en los workers</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatGeckoMobile("37.0")}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Característica</th>
<th>Android</th>
<th>Edge</th>
<th>Firefox Mobile (Gecko)</th>
<th>Firefox OS</th>
<th>IE Phone</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Soporte básico</td>
<td>4.4</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatGeckoMobile("22.0")}}<br>
{{CompatGeckoMobile("52.0")}}<sup>[1]</sup></td>
<td>1.0.1</td>
<td>10</td>
<td>22</td>
<td>8</td>
</tr>
<tr>
<td>Disponible en los workers</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatGeckoMobile("37.0")}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<p>[1] <code>indexedDB</code> se define ahora en el mixin {{domxref("WindowOrWorkerGlobalScope")}}.</p>
<h2 id="Ver_también">Ver también</h2>
<ul>
<li><a href="/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB">Utilización de IndexedDB</a></li>
<li>Iniciando transacciones: {{domxref("IDBDatabase")}}</li>
<li>Usando transacciones: {{domxref("IDBTransaction")}}</li>
<li>Estableciendo un rango de claves: {{domxref("IDBKeyRange")}}</li>
<li>Recuperación y edición de tus datos: {{domxref("IDBObjectStore")}}</li>
<li>Utilización de cursores: {{domxref("IDBCursor")}}</li>
<li>Ejemplo de referencia: <a class="external" href="https://github.com/mdn/to-do-notifications/tree/gh-pages">To-do Notifications</a> (<a class="external" href="http://mdn.github.io/to-do-notifications/">ver ejemplo <em>live</em></a>.)</li>
</ul>
|