aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/indexeddb/index.html
blob: b4ff7baa89f793e43575e0b306a1783734da3fff (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
---
title: WindowOrWorkerGlobalScope.indexedDB
slug: Web/API/indexedDB
translation_of: Web/API/WindowOrWorkerGlobalScope/indexedDB
original_slug: 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>

{{Compat("api.indexedDB")}}

<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>