From 427d145a860397e1b0c46b3e80bacffd24cf6344 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 25 Oct 2022 16:27:05 -0500 Subject: [PATCH 1/7] api/i-r html cleanup --- .../es/web/api/idbcursor/continue/index.html | 43 ++--- files/es/web/api/idbcursor/index.html | 11 +- files/es/web/api/idbdatabase/index.html | 2 +- .../api/idbdatabase/transaction/index.html | 17 +- .../es/web/api/idbobjectstore/add/index.html | 51 ++---- files/es/web/api/index.html | 2 +- files/es/web/api/indexeddb/index.html | 2 +- files/es/web/api/keyboardevent/index.html | 3 +- .../media_capture_and_streams_api/index.html | 155 ++++-------------- files/es/web/api/mediastreamtrack/index.html | 10 +- files/es/web/api/mutationobserver/index.html | 135 +++++---------- .../mutationobserver/index.html | 1 - .../api/mutationobserver/observe/index.html | 3 +- files/es/web/api/node/index.html | 15 +- files/es/web/api/node/insertbefore/index.html | 2 +- files/es/web/api/node/removechild/index.html | 4 +- .../web/api/node/selectstart_event/index.html | 2 +- files/es/web/api/node/textcontent/index.html | 2 +- files/es/web/api/nodelist/foreach/index.html | 2 +- files/es/web/api/nodelist/index.html | 3 - files/es/web/api/notification/index.html | 13 +- .../web/api/performance/clearmarks/index.html | 5 +- .../api/performance/clearmeasures/index.html | 5 +- files/es/web/api/performance/index.html | 2 +- .../web/api/performancenavigation/index.html | 3 +- files/es/web/api/response/index.html | 4 +- files/es/web/api/rtcpeerconnection/index.html | 2 +- 27 files changed, 144 insertions(+), 355 deletions(-) diff --git a/files/es/web/api/idbcursor/continue/index.html b/files/es/web/api/idbcursor/continue/index.html index b5c8efed7c9bb6..8c313e7d3750ab 100644 --- a/files/es/web/api/idbcursor/continue/index.html +++ b/files/es/web/api/idbcursor/continue/index.html @@ -33,37 +33,18 @@

Excepciones

Este método puede plantear un{{domxref("DOMException")}} con una {{domxref("DOMError")}} de uno de los siguientes tipos:

- - - - - - - - - - - - - - - - - - - - - -
ExcepciónDescripción
TransactionInactiveErrorEsta transacción en el Cursor IDB está inactiva.
DataError -

El parámetro de una tecla podría tener una de las siguientes condiciones:

- -
    -
  • La tecla no es una tecla valida.
  • -
  • La tecla está más atrás o en el mismo sitio que la posición del cursor y además la dirección del cursor es la siguiente o la única siguiente.
  • -
  • La tecla está más adelante o en el mismo sitio que la posición del cursor y además la dirección del cursor es previa o la única previa.
  • -
-
InvalidStateErrorEl cursor está siendo reiterado o se ha reiterado mas allá de su final.
-
+
+
TransactionInactiveError
Esta transacción en el Cursor IDB está inactiva.
DataError
+

El parámetro de una tecla podría tener una de las siguientes condiciones:

+ +
    +
  • La tecla no es una tecla valida.
  • +
  • La tecla está más atrás o en el mismo sitio que la posición del cursor y además la dirección del cursor es la siguiente o la única siguiente.
  • +
  • La tecla está más adelante o en el mismo sitio que la posición del cursor y además la dirección del cursor es previa o la única previa.
  • +
+
InvalidStateError
El cursor está siendo reiterado o se ha reiterado mas allá de su final.
+
+

Ejemplo

diff --git a/files/es/web/api/idbcursor/index.html b/files/es/web/api/idbcursor/index.html index d665d40508643b..97cba4d36d019a 100644 --- a/files/es/web/api/idbcursor/index.html +++ b/files/es/web/api/idbcursor/index.html @@ -35,9 +35,9 @@

Methods

{{domxref("IDBCursor.delete()")}}
-
Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, elimina el registro en la posición del cursor, sin cambiar la posición del cursor. Esto se puede utilizar para borrar registros específicos.
-
{{domxref("IDBCursor.update()")}}
-
Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, actualiza el valor en la posición actual del cursor en el almacén de objetos. Esto se puede utilizar para actualizar registros específicos.
+
Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, elimina el registro en la posición del cursor, sin cambiar la posición del cursor. Esto se puede utilizar para borrar registros específicos.

+ {{domxref("IDBCursor.update()")}}

+ Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, actualiza el valor en la posición actual del cursor en el almacén de objetos. Esto se puede utilizar para actualizar registros específicos.

Propiedades

@@ -46,11 +46,10 @@

Propiedades

{{domxref("IDBCursor.source")}} {{readonlyInline}}
Devuelve {{domxref("IDBObjectStore")}} o {{domxref("IDBIndex")}}} que el cursor está iterando. Esta función nunca devuelve nulo o lanza una excepción, incluso si el cursor está siendo iterado, ha iterado más allá de su final, o su transacción no está activa.
{{domxref("IDBCursor.direction")}} {{readonlyInline}}
-
Devuelve la dirección de desplazamiento del cursor. Ver Constants para valores posibles.
-
{{domxref("IDBCursor.key")}} {{readonlyInline}}
+
{{domxref("IDBCursor.key")}} {{readonlyInline}}
Devuelve la key del registro en la posición del cursor. Si el cursor está fuera de su rango, se fija en undefined. La key del cursor puede ser de cualquier tipo de datos.
-
{{domxref("IDBCursor.primaryKey")}} {{readonlyInline}}
+
{{domxref("IDBCursor.primaryKey")}} {{readonlyInline}}
Devuelve la key primaria efectiva actual del cursor. Si el cursor está siendo iterado o ha iterado fuera de su rango, se fija en undefined. La key principal del cursor puede ser cualquier tipo de datos.
diff --git a/files/es/web/api/idbdatabase/index.html b/files/es/web/api/idbdatabase/index.html index f537a7d17c368e..b6ce40a02cf80c 100644 --- a/files/es/web/api/idbdatabase/index.html +++ b/files/es/web/api/idbdatabase/index.html @@ -73,7 +73,7 @@

Example

In the following code snippet, we open a database asynchronously ({{domxref("IDBFactory")}}), handle success and error cases, and create a new object store in the case that an upgrade is needed ({{ domxref("IDBdatabase") }}). For a complete working example, see our To-do Notifications app (view example live.)

-
// Let us open our database
+
// Let us open our database
   var DBOpenRequest = window.indexedDB.open("toDoList", 4);
 
   // these two event handlers act on the IDBDatabase object, when the database is opened successfully, or not
diff --git a/files/es/web/api/idbdatabase/transaction/index.html b/files/es/web/api/idbdatabase/transaction/index.html
index 31a7f385d822ec..c5e74c52b36406 100644
--- a/files/es/web/api/idbdatabase/transaction/index.html
+++ b/files/es/web/api/idbdatabase/transaction/index.html
@@ -100,18 +100,15 @@ 

Parámetros

storeNames
Son los nombres de los almacenes de objetos e índices que están en el ámbito de la nueva transacción, declarados como un arreglo de cadenas de texto. Especifíca solamente aquellos a los que necesitas acceso.
- Si necesitas acceder a un solo almacén, puedes especificar su nombre como una cadena. Por tanto las siguientes líneas son equivalentes:
-
+ Si necesitas acceder a un solo almacén, puedes especificar su nombre como una cadena. Por tanto las siguientes líneas son equivalentes:

var transaction = db.transaction(['my-store-name']);
-var transaction = db.transaction('my-store-name');
-
-
Si necesitas acceder a todos los almacenes de objetos en la base de datos, puedes usar la propiedad {{domxref("IDBDatabase.objectStoreNames")}}: -
var transaction = db.transaction(db.objectStoreNames);
-
-
Pasar un arreglo vació como parámetro arrojará una excepción.
+var transaction = db.transaction('my-store-name');


+ Si necesitas acceder a todos los almacenes de objetos en la base de datos, puedes usar la propiedad {{domxref("IDBDatabase.objectStoreNames")}}: +
var transaction = db.transaction(db.objectStoreNames);


+ Pasar un arreglo vació como parámetro arrojará una excepción.
mode
-
Opcional. Los tipos de acceso que pueden desempeñarse en la transacción. Las transacciones son abiertas en uno de tres modos: readonly [sólo lectura], readwrite [lectura/escritura], y readwriteflush [descarga de lectura/escritura] (no-estándar, sólo para Firefox). El modo versionchange [cambio de versión] no puede ser especificado aquí. Si no provees un parámetro, el modo predeterminado será readonly [sólo lectura]. Para evitar ralentizar las cosas, no abras una transacción readwrite [lectura/escritura] a menos que realmente necesites escribir en la base de datos.
-
Si necesitas abrir un almacén de objetos en modo readwrite para cambiar los datos, usa lo siguiente: +
Opcional. Los tipos de acceso que pueden desempeñarse en la transacción. Las transacciones son abiertas en uno de tres modos: readonly [sólo lectura], readwrite [lectura/escritura], y readwriteflush [descarga de lectura/escritura] (no-estándar, sólo para Firefox). El modo versionchange [cambio de versión] no puede ser especificado aquí. Si no provees un parámetro, el modo predeterminado será readonly [sólo lectura]. Para evitar ralentizar las cosas, no abras una transacción readwrite [lectura/escritura] a menos que realmente necesites escribir en la base de datos.

+ Si necesitas abrir un almacén de objetos en modo readwrite para cambiar los datos, usa lo siguiente:
var transaction = db.transaction('my-store-name', "readwrite");

Desde Firefox 40, las transacciones de IndexedDB tienen garantías de durabilidad relajadas para aumentar el rendimiento (ver {{Bug("1112702")}}), lo cual es el mismo comportamiento de otros navegadores que soportan IndexedDB. Es decir, anteriormente en una transacción readwrite el evento {{domxref("IDBTransaction.oncomplete")}} era invocado sólo cuando se garantizaba que todos los datos habían sido vaciados al disco duro. En Firefox 40+ el evento complete es accionado después de indicársele al Sistema Operativo que escriba los datos al disco pero esta confirmación podría suceder poco antes de que los datos hayan sido verdaderamente escritos en él. Si bien dicho evento puede entonces ser entregado un poco antes de tiempo, de cualquier modo, existe una pequeña probabilidad de que la entera transacción se pierda si el SO se bloquea o si ha ocurrido una pérdida de energía antes de que los datos efectivamente se descarguen al disco duro. Como esas catastróficas circunstancias son más bien raras, la mayoría de los consumidores no deberían preocuparse demasiado.

diff --git a/files/es/web/api/idbobjectstore/add/index.html b/files/es/web/api/idbobjectstore/add/index.html index cbef2e3113479e..9384d0d650933b 100644 --- a/files/es/web/api/idbobjectstore/add/index.html +++ b/files/es/web/api/idbobjectstore/add/index.html @@ -23,44 +23,19 @@

Retorno

Un objeto {{domxref("IDBRequest")}} en el que los eventos subsecuentes relacionados a esta operación son lanzados.

Excepciones

Este método puede generar un {{domxref("DOMException")}} con un {{domxref("DOMError")}} de uno de los siguiente tipos:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ExcepciónDescripción
ReadOnlyErrorLa transacción asociada con esta operación está en un modo de sólo lectura.
TransactionInactiveErrorEsta transacción de {{domxref("IDBObjectStore")}}'s está inactiva.
DataError -

Cualquiera de los siguientes condiciones aplica:

-
    -
  • El almacén de objetos usa llaves en línea o tiene un generador de llaves, y una argumento llave fue proporcionado.
  • -
  • El almacén de objetos usa llaves fuera de línea y no tiene un generador de llaves, y un argumento llave fue proporcionado.
  • -
  • El almacén de objetos usa llaves en línea pero no un generador de llaves, y la ruta de la llave del almacén de objetos no da una llave válida.
  • -
  • El argumento llave fue proporcionado pero no contiene una llave válida.
  • -
-
InvalidStateErrorEl {{domxref("IDBObjectStore")}} ha sido borrado o removido.
DataCloneErrorLos datos siendo almacenados no pueden ser clonados por el algoritmo de clonado estructurado interno.
+ +
+
ReadOnlyError
La transacción asociada con esta operación está en un modo de sólo lectura.
TransactionInactiveError
Esta transacción de IDBObjectStore's está inactiva.
DataError
+

Cualquiera de los siguientes condiciones aplica:

+
    +
  • El almacén de objetos usa llaves en línea o tiene un generador de llaves, y una argumento llave fue proporcionado.
  • +
  • El almacén de objetos usa llaves fuera de línea y no tiene un generador de llaves, y un argumento llave fue proporcionado.
  • +
  • El almacén de objetos usa llaves en línea pero no un generador de llaves, y la ruta de la llave del almacén de objetos no da una llave válida.
  • +
  • El argumento llave fue proporcionado pero no contiene una llave válida.
  • +
+
InvalidStateError
El IDBObjectStore ha sido borrado o removido.
DataCloneError
Los datos siendo almacenados no pueden ser clonados por el algoritmo de clonado estructurado interno.
+
+

Ejemplo

En el siguiente código, abrimos una transacción read/write en nuestra base de datos y agregado algunos datos al almacén de datos usando add(). También ten en cuenta que las funciones adjuntas a los manejadores de eventos de la transacción para informar en la salida de la apertura de transacciones en el evento de éxito o falla. Para un ejemplo completo funcionando, mira nuestra aplicación To-do Notifications (ver ejemplo).

// Abrimos nuestra base de datos
diff --git a/files/es/web/api/index.html b/files/es/web/api/index.html
index 9b64de862e84ac..cc3173dacca0c4 100644
--- a/files/es/web/api/index.html
+++ b/files/es/web/api/index.html
@@ -9,7 +9,7 @@
   - Web
 translation_of: Web/API
 ---
-

Cuando escribimos código para la web utilizando JavaScript, podemos usar gran número de APIs disponibles. A continuación mostramos una lista de todas las interfaces (es decir, tipos de objetos) que puedes usar al desarrollar tu aplicación o sitio Web. Para obtener una lista de las API que contiene cada una de estas interfaces, consulta la referencia de la API Web.

+

Cuando escribimos código para la web utilizando JavaScript, podemos usar gran número de APIs disponibles. A continuación mostramos una lista de todas las interfaces (es decir, tipos de objetos) que puedes usar al desarrollar tu aplicación o sitio Web. Para obtener una lista de las API que contiene cada una de estas interfaces, consulta la referencia de la API Web.

{{APIListAlpha}}
diff --git a/files/es/web/api/indexeddb/index.html b/files/es/web/api/indexeddb/index.html index dd3c5c8011c1ff..fd93653a4eb5bb 100644 --- a/files/es/web/api/indexeddb/index.html +++ b/files/es/web/api/indexeddb/index.html @@ -18,7 +18,7 @@

Valor

Ejemplo

-
var db;
+
var db;
 function openDB() {
  var DBOpenRequest = window.indexedDB.open('toDoList');
  DBOpenRequest.onsuccess = function(e) {
diff --git a/files/es/web/api/keyboardevent/index.html b/files/es/web/api/keyboardevent/index.html
index 3291e436d8f12d..b47ef9283b032a 100644
--- a/files/es/web/api/keyboardevent/index.html
+++ b/files/es/web/api/keyboardevent/index.html
@@ -39,8 +39,7 @@ 

Propiedades

{{domxref("KeyboardEvent.altKey")}} {{Readonlyinline}}
Devuelve un {{jsxref("Boolean")}} que será true si la tecla Alt ( Option or on OS X) fue activada cuando el evento fue generado.
{{domxref("KeyboardEvent.char")}} {{Non-standard_inline()}}{{Deprecated_inline}}{{Readonlyinline}}
-
Devuelve un {{domxref("DOMString")}} representando el valor del carácter de la tecla. Si la tecla corresponde con un carácter imprimible, este valor es una cadena Unicode no vacía que contiene este carácter. Si la tecla no tiene una representación imprimible, esta es una cadena vacía.
-
+
Devuelve un {{domxref("DOMString")}} representando el valor del carácter de la tecla. Si la tecla corresponde con un carácter imprimible, este valor es una cadena Unicode no vacía que contiene este carácter. Si la tecla no tiene una representación imprimible, esta es una cadena vacía.

Nota: Si la tecla es usada como una macro que inserta múltiples caracteres, If the key is used as a macro that inserts multiple characters, el valor de este atributo es la cadena completa, no solo el primer carácter.
Advertencia: Esta propiedad ha sido eliminada de los eventos del DOM de nivel 3. Esta es únicamente soportada en IE.
diff --git a/files/es/web/api/media_capture_and_streams_api/index.html b/files/es/web/api/media_capture_and_streams_api/index.html index 992b017a4e3c71..97c8f634ed2203 100644 --- a/files/es/web/api/media_capture_and_streams_api/index.html +++ b/files/es/web/api/media_capture_and_streams_api/index.html @@ -43,136 +43,38 @@

Referencia

Pista de MediaStream

Una MediaStreamTrack puede ser de dos tipos, de audio o video, y representa el origen del medio, como una cámara.

Atributos

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AtributoTipoDescripción
enabledBoolean True si la pista sigue asociada a su fuente.
idDOMString, read-onlyUn globally unique identifier (GUID) que describe la pista de medios.
kindDOMString, read-onlyEl audio o video para la pista de origen.
labelDOMString, read-onlyUna cadena de tipo usuario-asignada que identifica la pista de origen, como en "internal microphone."
onendedEventHandlerManeja el evento finalizado cuando se lo activa en el objeto MediaStreamTrack.
onmute EventHandlerManeja el evento mudo del objeto MediaStreamTrack.
onoverconstrainedEventHandlerManeja el evento superrestricto cuando se lo activa en el objeto MediaStreamTrack.
onstartedEventHandlerManeja el evento iniciado cuando se lo activa en el objeto MediaStreamTrack.
onunmute EventHandlerManjea el evento sin enmudecer cuando se lo activa en el objeto MediaStreamTrack.
readyStateunsigned short, read-only -

Valores para la pista lista:

-
    -
  • live - la pista está activa; la salida se puede activar on y off con el atributo habilitado.
  • -
  • muted - el origen del medio subyacente de la pista no puede proveer temporalmente datos en tiempo real.
  • -
-
sourceIdDOMString, read-onlyLa identidad de este origen que es único para esta aplicación y persistente. Se recomienda una GUID pero no es obligatoria.
sourceTypeSourceTypeEnum, read-onlyContiene el tipo de información del origen, si es que existe.
+ +
+
enabled: Boolean
True si la pista sigue asociada a su fuente.
id: DOMString, read-only
Un globally unique identifier (GUID) que describe la pista de medios.
kind: DOMString, read-only
El audio o video para la pista de origen.
label: DOMString, read-only
Una cadena de tipo usuario-asignada que identifica la pista de origen, como en "internal microphone."
onended: EventHandler
Maneja el evento finalizado cuando se lo activa en el objeto MediaStreamTrack.
onmute : EventHandler
Maneja el evento mudo del objeto MediaStreamTrack.
onoverconstrained: EventHandler
Maneja el evento superrestricto cuando se lo activa en el objeto MediaStreamTrack.
onstarted: EventHandler
Maneja el evento iniciado cuando se lo activa en el objeto MediaStreamTrack.
onunmute : EventHandler
Manjea el evento sin enmudecer cuando se lo activa en el objeto MediaStreamTrack.
readyState: unsigned short, read-only
+

Valores para la pista lista:

+
    +
  • live - la pista está activa; la salida se puede activar on y off con el atributo habilitado.
  • +
  • muted - el origen del medio subyacente de la pista no puede proveer temporalmente datos en tiempo real.
  • +
+
sourceId: DOMString, read-only
La identidad de este origen que es único para esta aplicación y persistente. Se recomienda una GUID pero no es obligatoria.
sourceType: SourceTypeEnum, read-only
Contiene el tipo de información del origen, si es que existe.
+
+

Eventos

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventoInterfazDescripción
startedEventEl objeto MediaStreamTrack no es más "new" en el readyState.
mutedEventEl origen del objeto MediaStreamTrack no puede proveer datos temporalmente.
unmuted EventEl origen del objeto MediaStreamTrack a recomenzado a proveer datos
overconstrainedEventEl origen del objeto MediaStreamTrack no puede ser confugurado para que encaje en las restricciones impuestas por la pista. Esto podría ocurrir con la altura en el caso de un video, entre otras posibilidades.
endedEvent -

El origen del objeto MediaStreamTrack no proveerá datos; puede ocurrir por lo siguiente:

-
    -
  • el usuario a deshabilitado los permisos de la aplicación
  • -
  • el dispositivo de origen está desconectado
  • -
  • el peer remoto no transmite datos
  • -
  • se llamó el método stop()
  • -
-
+ +
+
started: Event
El objeto MediaStreamTrack no es más "new" en el readyState.
muted: Event
El origen del objeto MediaStreamTrack no puede proveer datos temporalmente.
unmuted : Event
El origen del objeto MediaStreamTrack a recomenzado a proveer datos
overconstrained: Event
El origen del objeto MediaStreamTrack no puede ser confugurado para que encaje en las restricciones impuestas por la pista. Esto podría ocurrir con la altura en el caso de un video, entre otras posibilidades.
ended: Event
+

El origen del objeto MediaStreamTrack no proveerá datos; puede ocurrir por lo siguiente:

+
    +
  • el usuario a deshabilitado los permisos de la aplicación
  • +
  • el dispositivo de origen está desconectado
  • +
  • el peer remoto no transmite datos
  • +
  • se llamó el método stop()
  • +
+
+
+

appendConstraint()

Agrega la restricción al final de la lista. Esto sólo es un método para añadir restricciones optativas.

Parámetros
- constraintName DOMString, required.
-
+ constraintName DOMString, required.

constraintValue Primitive (DOMString, float, etc.) or MinMaxConstraint, required.
Devuelve
@@ -211,7 +113,7 @@

constraints()

MediaTrackConstraints or null
- Excepciones
+ Excepciones
None.
@@ -226,8 +128,7 @@

getConstraint()

Parámetros
- constraintName DOMString, required.
-
+ constraintName DOMString, required.

mandatory boolean, optional, default false.
Devuelve
@@ -321,7 +222,7 @@

add()

INVALID_STATE_ERR if the stream is finished (all tracks have ended).
-

item()

+

item()

Devuelve la MediaStreamTrack al valor de índice (index) especificado.

diff --git a/files/es/web/api/mediastreamtrack/index.html b/files/es/web/api/mediastreamtrack/index.html index d48765320333dd..09c58f236e0d30 100644 --- a/files/es/web/api/mediastreamtrack/index.html +++ b/files/es/web/api/mediastreamtrack/index.html @@ -54,15 +54,15 @@

Métodos

{{domxref("MediaStreamTrack.getConstraints()")}}
-
+
Empty
{{domxref("MediaStreamTrack.applyConstraints()")}}
-
+
Empty
{{domxref("MediaStreamTrack.getSettings()")}}
-
+
Empty
{{domxref("MediaStreamTrack.getCapabilities()")}}
-
+
Empty
{{domxref("MediaStreamTrack.clone()")}}
-
+
Empty
{{domxref("MediaStreamTrack.stop()")}}
Detiene la reproducción del origen asociado a la pista, pero el origen y la pista son desasociados. El estado de la pista es un conjunto de ended.
diff --git a/files/es/web/api/mutationobserver/index.html b/files/es/web/api/mutationobserver/index.html index f29c32197e4e4b..7a1082eb7a28ac 100644 --- a/files/es/web/api/mutationobserver/index.html +++ b/files/es/web/api/mutationobserver/index.html @@ -141,99 +141,48 @@

MutationRecord

MutationRecord es el objeto que será pasado a la funcion "callback" del observador. Tiene las siguientes propiedades:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropiedadTipoDescripción
typeString -

Devuelve:

- -
    -
  • attributes si el cambio fué en un atributo
  • -
  • characterData si se produjo en un nodo.
  • -
  • childList si se produjo en los nodos del árbol.
  • -
- -
-
-
target{{domxref("Node")}} -

Devuelve el nodo afectado por el cambio, dependiendo del type:

- -
    -
  • Para attributes, el elemento cuyos atributos han cambiado.
  • -
  • Para characterData, el nodo CharacterData.
  • -
  • Para childList, El nodo padre cuyos hijos han cambiado.
  • -
-
addedNodes{{domxref("NodeList")}} -

Devuelve los nodos añadidos. Si no tiene nodos añadidos devuelve un NodeList vacio.

-
removedNodes{{domxref("NodeList")}} -

Devuelve los nodos eliminados. Si no tiene nodos eliminados devuelve un NodeList vacio.

-
previousSibling{{domxref("Node")}} -

Devuelve el nodo hermano anterior añadido o eliminado, o el valor null.

-
nextSibling{{domxref("Node")}} -

Devuelve el siguiente nodo hermano añadido o eliminado, o el valor null.

-
attributeNameString -

Devuelve el nombre local del atributo cambiado, o el valor null.

-
attributeNamespaceString -

Devuelve espacio de nombres (namespace) del atributo cambiado, o el valor null.

-
oldValueString -

El valor devuelto depende del type:

- -
    -
  • Para attributes,el valor anterior del atributo.
  • -
  • Para characterData,los datos antes del cambio
  • -
  • Para childList,devuelve null.
  • -
-
+
+
type: String
+

Devuelve:

+ +
    +
  • attributes si el cambio fué en un atributo
  • +
  • characterData si se produjo en un nodo.
  • +
  • childList si se produjo en los nodos del árbol.
  • +
+ +
+
+
target: Node
+

Devuelve el nodo afectado por el cambio, dependiendo del type:

+ +
    +
  • Para attributes, el elemento cuyos atributos han cambiado.
  • +
  • Para characterData, el nodo CharacterData.
  • +
  • Para childList, El nodo padre cuyos hijos han cambiado.
  • +
+
addedNodes: NodeList
+

Devuelve los nodos añadidos. Si no tiene nodos añadidos devuelve un NodeList vacio.

+
removedNodes: NodeList
+

Devuelve los nodos eliminados. Si no tiene nodos eliminados devuelve un NodeList vacio.

+
previousSibling: Node
+

Devuelve el nodo hermano anterior añadido o eliminado, o el valor null.

+
nextSibling: Node
+

Devuelve el siguiente nodo hermano añadido o eliminado, o el valor null.

+
attributeName: String
+

Devuelve el nombre local del atributo cambiado, o el valor null.

+
attributeNamespace: String
+

Devuelve espacio de nombres (namespace) del atributo cambiado, o el valor null.

+
oldValue: String
+

El valor devuelto depende del type:

+ +
    +
  • Para attributes,el valor anterior del atributo.
  • +
  • Para characterData,los datos antes del cambio
  • +
  • Para childList,devuelve null.
  • +
+
+

Ejemplo de uso

diff --git a/files/es/web/api/mutationobserver/mutationobserver/index.html b/files/es/web/api/mutationobserver/mutationobserver/index.html index b9046a4c4dee82..4191153344fefb 100644 --- a/files/es/web/api/mutationobserver/mutationobserver/index.html +++ b/files/es/web/api/mutationobserver/mutationobserver/index.html @@ -16,7 +16,6 @@

Parámetros

callback
La función que será llamada con cada cambio en el DOM, determinado por el nodo, subárbol y opciones. Esta función toma dos parámetros de entrada: un array de objetos {{domxref("MutationRecord")}}, con los cambios producidos, y el MutationObserver que llamó a la función. Para mas detalles vea example
-

Valor devuelto

diff --git a/files/es/web/api/mutationobserver/observe/index.html b/files/es/web/api/mutationobserver/observe/index.html index 01a4efb51eebbd..3bb4433e6764e4 100644 --- a/files/es/web/api/mutationobserver/observe/index.html +++ b/files/es/web/api/mutationobserver/observe/index.html @@ -36,8 +36,7 @@

Excepciones

TypeError
-
llamado en cualquiera de las siguientes circunstancias
-
+
llamado en cualquiera de las siguientes circunstancias
  • Las opciones han sido configuradas de tal modo que no existe nada que monitorizar (por ejemplo, si {{domxref("MutationObserverInit.childList")}}, {{domxref("MutationObserverInit.attributes")}}, y {{domxref("MutationObserverInit.characterData")}} son false)
  • La opcion attributes es false (indicando que los cambios en los atributos no son monitorizados) y attributeOldValue es true y/o attributeFilter está presente.
  • diff --git a/files/es/web/api/node/index.html b/files/es/web/api/node/index.html index 937bb35f3e1e9c..d67fc4ceab6b9c 100644 --- a/files/es/web/api/node/index.html +++ b/files/es/web/api/node/index.html @@ -130,9 +130,9 @@

    Methods

    {{domxref("Node.cloneNode()")}}
    Clone a {{domxref("Node")}}, and optionally, all of its contents. By default, it clones the content of the node.
    {{domxref("Node.compareDocumentPosition()")}}
    -
    +
    Empty
    {{domxref("Node.contains()")}}
    -
    +
    Empty
    {{domxref("Node.getFeature()")}} {{obsolete_inline}}
    ...
    {{domxref("Node.getUserData()")}} {{obsolete_inline}}
    @@ -144,17 +144,17 @@

    Methods

    {{domxref("Node.insertBefore()")}}
    Inserts the first {{domxref("Node")}} given in a parameter immediately before the second, child of this element, {{domxref("Node")}}.
    {{domxref("Node.isDefaultNamespace()")}}
    -
    +
    Empty
    {{domxref("Node.isEqualNode()")}}
    -
    +
    Empty
    {{domxref("Node.isSameNode()")}} {{obsolete_inline}}
    -
    +
    Empty
    {{domxref("Node.isSupported()")}} {{obsolete_inline}}
    Returns a Boolean flag containing the result of a test whether the DOM implementation implements a specific feature and this feature is supported by the specific node.
    {{domxref("Node.lookupPrefix()")}}
    -
    +
    Empty
    {{domxref("Node.lookupNamespaceURI()")}}
    -
    +
    Empty
    {{domxref("Node.normalize()")}}
    Clean up all the text nodes under this element (merge adjacent, remove empty).
    {{domxref("Node.removeChild()")}}
    @@ -163,7 +163,6 @@

    Methods

    Replaces one child {{domxref("Node")}} of the current one with the second one given in parameter.
    {{domxref("Node.setUserData()")}} {{obsolete_inline}}
    Allows a user to attach, or remove, {{domxref("DOMUserData")}} to the node.
    -

Examples

diff --git a/files/es/web/api/node/insertbefore/index.html b/files/es/web/api/node/insertbefore/index.html index 50148503a98f97..3d18fd06c57275 100644 --- a/files/es/web/api/node/insertbefore/index.html +++ b/files/es/web/api/node/insertbefore/index.html @@ -126,7 +126,7 @@

Compatibilidad en navegadores

Especificaciones

- +
diff --git a/files/es/web/api/node/removechild/index.html b/files/es/web/api/node/removechild/index.html index b6db11cc3a1ae7..c176e8a31ff415 100644 --- a/files/es/web/api/node/removechild/index.html +++ b/files/es/web/api/node/removechild/index.html @@ -6,9 +6,9 @@
{{APIRef ( "DOM")}}
-

El método Node.removeChild() elimina un nodo hijo del DOM y puede devolver el nodo eliminado.

+

El método Node.removeChild() elimina un nodo hijo del DOM y puede devolver el nodo eliminado.

-

Sintaxis

+

Sintaxis

var antiguoHijo = elemento.removeChild(child);
diff --git a/files/es/web/api/node/selectstart_event/index.html b/files/es/web/api/node/selectstart_event/index.html
index 4f4f3c8609e49c..3a3761056f18d9 100644
--- a/files/es/web/api/node/selectstart_event/index.html
+++ b/files/es/web/api/node/selectstart_event/index.html
@@ -24,7 +24,7 @@ 

Ejemplo

Especificaciones

-
Especificación
+
diff --git a/files/es/web/api/node/textcontent/index.html b/files/es/web/api/node/textcontent/index.html index 46dc7d9fefc34c..c5afcc1dd41909 100644 --- a/files/es/web/api/node/textcontent/index.html +++ b/files/es/web/api/node/textcontent/index.html @@ -70,7 +70,7 @@

Compatibilidad con navegadores

Especificación

-
Especificación
+
diff --git a/files/es/web/api/nodelist/foreach/index.html b/files/es/web/api/nodelist/foreach/index.html index 3df8a59fbaf6f5..42f052e5cc1adc 100644 --- a/files/es/web/api/nodelist/foreach/index.html +++ b/files/es/web/api/nodelist/foreach/index.html @@ -47,7 +47,7 @@

Excepciones

Ejemplo

-
var nodo = document.createElement("div");
+
var nodo = document.createElement("div");
 var infante1 = document.createElement("p");
 var infante2 = document.createTextNode("hey");
 var infante3 = document.createElement("span");
diff --git a/files/es/web/api/nodelist/index.html b/files/es/web/api/nodelist/index.html
index b50a0ea0325836..ba14f3424fa85b 100644
--- a/files/es/web/api/nodelist/index.html
+++ b/files/es/web/api/nodelist/index.html
@@ -42,9 +42,6 @@ 

Métodos

{{domxref("NodeList.item()")}}
-
- -
Devuelve un elemento en la lista por su índice, o null si el índice está fuera de límites; se puede utilizar como una alternativa para acceder simplemente a nodeList[idx] (que en cambio devuelve indefinido cuando idx está fuera de límites).
{{domxref("NodeList.entries()")}}
Devuelve un {{jsxref ("Iteration_protocols", "iterator")}} que permite pasar por todos los pares clave / valor contenidos en este objeto.
diff --git a/files/es/web/api/notification/index.html b/files/es/web/api/notification/index.html index ea182e69a6ea16..2e920e475715a7 100644 --- a/files/es/web/api/notification/index.html +++ b/files/es/web/api/notification/index.html @@ -119,22 +119,23 @@

Obsolete handlers

A handler for the {{event("close")}} event. It is triggered when the user closes the notification.
{{domxref("Notification.onshow")}}
A handler for the {{event("show")}} event. It is triggered when the notification is displayed.
-
+
+

Methods

Static methods

- Estos métodos están disponibles solo en el objeto de Notificación en sí. -
+ Estos métodos están disponibles solo en el objeto de Notificación en sí. +
{{domxref("Notification.requestPermission()")}}
Solicita permiso del usuario para mostrar notificaciones.
-
+

Instance methods

These properties are available only on an instance of the Notification object or through its prototype. The Notification object also inherits from the {{domxref("EventTarget")}} interface.

- +
{{domxref("Notification.close()")}}
Programmatically closes a notification.
-
+

Example

Assume this basic HTML:

diff --git a/files/es/web/api/performance/clearmarks/index.html b/files/es/web/api/performance/clearmarks/index.html index f68ff61bc3203e..7abea9d69298ea 100644 --- a/files/es/web/api/performance/clearmarks/index.html +++ b/files/es/web/api/performance/clearmarks/index.html @@ -29,10 +29,7 @@

Argumentos

Valor de retorno

-
-
vacío
-
-
+Ninguno

Ejemplo

diff --git a/files/es/web/api/performance/clearmeasures/index.html b/files/es/web/api/performance/clearmeasures/index.html index fd896cd339ee44..144a480255bcc6 100644 --- a/files/es/web/api/performance/clearmeasures/index.html +++ b/files/es/web/api/performance/clearmeasures/index.html @@ -29,10 +29,7 @@

Argumentos

Valor de retorno

-
-
vacío
-
-
+Ninguno

Ejemplo

diff --git a/files/es/web/api/performance/index.html b/files/es/web/api/performance/index.html index 6a975f9d0a0c9c..5b9934b9035d38 100644 --- a/files/es/web/api/performance/index.html +++ b/files/es/web/api/performance/index.html @@ -16,7 +16,7 @@

Un objeto de este tipo puede ser obtenido por el llamado de el atributo de solo lectura {{domxref("Window.performance")}}.

-
+

Nota: Esta interfaz y sus miembros están disponibles en Web Workers, exceptuando en los mencionados abajo. También, tenga en cuenta que las marcas y medidas de rendimiento son por contexto. Si crea una marca en el hilo principal (u otro worker), no puedes verlo en un hilo de un worker, y vice versa.

diff --git a/files/es/web/api/performancenavigation/index.html b/files/es/web/api/performancenavigation/index.html index 60ed7f1ce45203..d1320c30f3c899 100644 --- a/files/es/web/api/performancenavigation/index.html +++ b/files/es/web/api/performancenavigation/index.html @@ -30,8 +30,7 @@

Propiedades

{{deprecated_inline}} {{domxref("PerformanceNavigation.type")}} {{readonlyInline}}
-
Un unsigned short el cual indica cómo la navegación en esta página fue hecha. Los valores posibles son:
-
+
Un unsigned short el cual indica cómo la navegación en esta página fue hecha. Los valores posibles son:u
TYPE_NAVIGATE (0)
La página fue accesada por un link, un marcador, un formulario enviado, o un script, o escribiendo la URL en la barra de direcciones.
diff --git a/files/es/web/api/response/index.html b/files/es/web/api/response/index.html index a24047baee01ae..759d2dd7bbe4bd 100644 --- a/files/es/web/api/response/index.html +++ b/files/es/web/api/response/index.html @@ -61,8 +61,8 @@

Methods

{{domxref("Response.error()")}}
Devuelve un nuevo objeto Respuesta asociado a un error de red.
{{domxref("Response.redirect()")}}
-
Crea una nueva respuesta con un URL distinto.
-
Response iimplementa {{domxref("Body")}}, de modo que además contiene los métodos que se detallan a continuación:
+
Crea una nueva respuesta con un URL distinto. + Response iimplementa {{domxref("Body")}}, de modo que además contiene los métodos que se detallan a continuación:
diff --git a/files/es/web/api/rtcpeerconnection/index.html b/files/es/web/api/rtcpeerconnection/index.html index 77e4b0b0462d75..1e7b49c845d1e4 100644 --- a/files/es/web/api/rtcpeerconnection/index.html +++ b/files/es/web/api/rtcpeerconnection/index.html @@ -255,7 +255,7 @@

RTCSignalingState enum

From 984ff7ee59bd1308049d6cc1e5e82a3b2eaf96d9 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 25 Oct 2022 16:39:44 -0500 Subject: [PATCH 2/7] api/i-r rename html to md 6df3bf5 --- files/es/web/api/idbcursor/continue/{index.html => index.md} | 0 files/es/web/api/idbcursor/{index.html => index.md} | 0 files/es/web/api/idbdatabase/{index.html => index.md} | 0 files/es/web/api/idbdatabase/transaction/{index.html => index.md} | 0 files/es/web/api/idbobjectstore/add/{index.html => index.md} | 0 files/es/web/api/idbobjectstore/{index.html => index.md} | 0 files/es/web/api/imagebitmap/{index.html => index.md} | 0 .../web/api/imagebitmaprenderingcontext/{index.html => index.md} | 0 files/es/web/api/{index.html => index.md} | 0 files/es/web/api/indexeddb/{index.html => index.md} | 0 files/es/web/api/indexeddb_api/{index.html => index.md} | 0 .../api/indexeddb_api/using_indexeddb/{index.html => index.md} | 0 .../es/web/api/intersection_observer_api/{index.html => index.md} | 0 files/es/web/api/issecurecontext/{index.html => index.md} | 0 files/es/web/api/keyboardevent/{index.html => index.md} | 0 files/es/web/api/location/{index.html => index.md} | 0 files/es/web/api/location/origin/{index.html => index.md} | 0 files/es/web/api/location/reload/{index.html => index.md} | 0 .../api/media_capture_and_streams_api/{index.html => index.md} | 0 .../taking_still_photos/{index.html => index.md} | 0 .../es/web/api/mediadevices/getusermedia/{index.html => index.md} | 0 files/es/web/api/mediadevices/{index.html => index.md} | 0 .../web/api/mediaquerylist/addlistener/{index.html => index.md} | 0 files/es/web/api/mediaquerylist/{index.html => index.md} | 0 files/es/web/api/mediaquerylist/matches/{index.html => index.md} | 0 .../api/mediaquerylist/removelistener/{index.html => index.md} | 0 files/es/web/api/mediastreamtrack/{index.html => index.md} | 0 files/es/web/api/messageevent/{index.html => index.md} | 0 files/es/web/api/mimetype/{index.html => index.md} | 0 files/es/web/api/mouseevent/{index.html => index.md} | 0 .../es/web/api/mouseevent/initmouseevent/{index.html => index.md} | 0 files/es/web/api/mouseevent/pagex/{index.html => index.md} | 0 files/es/web/api/mouseevent/shiftkey/{index.html => index.md} | 0 files/es/web/api/mutationobserver/{index.html => index.md} | 0 .../mutationobserver/mutationobserver/{index.html => index.md} | 0 .../es/web/api/mutationobserver/observe/{index.html => index.md} | 0 files/es/web/api/network_information_api/{index.html => index.md} | 0 files/es/web/api/node/appendchild/{index.html => index.md} | 0 files/es/web/api/node/childnodes/{index.html => index.md} | 0 files/es/web/api/node/clonenode/{index.html => index.md} | 0 files/es/web/api/node/contains/{index.html => index.md} | 0 files/es/web/api/node/haschildnodes/{index.html => index.md} | 0 files/es/web/api/node/{index.html => index.md} | 0 files/es/web/api/node/insertbefore/{index.html => index.md} | 0 files/es/web/api/node/issamenode/{index.html => index.md} | 0 files/es/web/api/node/lastchild/{index.html => index.md} | 0 files/es/web/api/node/nextsibling/{index.html => index.md} | 0 files/es/web/api/node/nodename/{index.html => index.md} | 0 files/es/web/api/node/nodetype/{index.html => index.md} | 0 files/es/web/api/node/nodevalue/{index.html => index.md} | 0 files/es/web/api/node/ownerdocument/{index.html => index.md} | 0 files/es/web/api/node/parentelement/{index.html => index.md} | 0 files/es/web/api/node/parentnode/{index.html => index.md} | 0 files/es/web/api/node/previoussibling/{index.html => index.md} | 0 files/es/web/api/node/removechild/{index.html => index.md} | 0 files/es/web/api/node/replacechild/{index.html => index.md} | 0 files/es/web/api/node/selectstart_event/{index.html => index.md} | 0 files/es/web/api/node/textcontent/{index.html => index.md} | 0 files/es/web/api/nodelist/foreach/{index.html => index.md} | 0 files/es/web/api/nodelist/{index.html => index.md} | 0 files/es/web/api/notification/{index.html => index.md} | 0 files/es/web/api/notifications_api/{index.html => index.md} | 0 files/es/web/api/payment_request_api/{index.html => index.md} | 0 files/es/web/api/performance/clearmarks/{index.html => index.md} | 0 .../es/web/api/performance/clearmeasures/{index.html => index.md} | 0 files/es/web/api/performance/{index.html => index.md} | 0 files/es/web/api/performance/memory/{index.html => index.md} | 0 files/es/web/api/performance/navigation/{index.html => index.md} | 0 files/es/web/api/performance/now/{index.html => index.md} | 0 files/es/web/api/performance/timeorigin/{index.html => index.md} | 0 files/es/web/api/performance/timing/{index.html => index.md} | 0 files/es/web/api/performancenavigation/{index.html => index.md} | 0 files/es/web/api/pointer_lock_api/{index.html => index.md} | 0 files/es/web/api/push_api/{index.html => index.md} | 0 files/es/web/api/pushmanager/{index.html => index.md} | 0 .../supportedcontentencodings/{index.html => index.md} | 0 files/es/web/api/range/collapsed/{index.html => index.md} | 0 .../api/range/commonancestorcontainer/{index.html => index.md} | 0 files/es/web/api/range/getclientrects/{index.html => index.md} | 0 files/es/web/api/range/{index.html => index.md} | 0 files/es/web/api/range/setstart/{index.html => index.md} | 0 files/es/web/api/request/headers/{index.html => index.md} | 0 files/es/web/api/request/{index.html => index.md} | 0 files/es/web/api/response/{index.html => index.md} | 0 files/es/web/api/response/ok/{index.html => index.md} | 0 files/es/web/api/response/response/{index.html => index.md} | 0 files/es/web/api/response/status/{index.html => index.md} | 0 .../cantrickleicecandidates/{index.html => index.md} | 0 files/es/web/api/rtcpeerconnection/{index.html => index.md} | 0 files/es/web/api/rtcrtpreceiver/{index.html => index.md} | 0 90 files changed, 0 insertions(+), 0 deletions(-) rename files/es/web/api/idbcursor/continue/{index.html => index.md} (100%) rename files/es/web/api/idbcursor/{index.html => index.md} (100%) rename files/es/web/api/idbdatabase/{index.html => index.md} (100%) rename files/es/web/api/idbdatabase/transaction/{index.html => index.md} (100%) rename files/es/web/api/idbobjectstore/add/{index.html => index.md} (100%) rename files/es/web/api/idbobjectstore/{index.html => index.md} (100%) rename files/es/web/api/imagebitmap/{index.html => index.md} (100%) rename files/es/web/api/imagebitmaprenderingcontext/{index.html => index.md} (100%) rename files/es/web/api/{index.html => index.md} (100%) rename files/es/web/api/indexeddb/{index.html => index.md} (100%) rename files/es/web/api/indexeddb_api/{index.html => index.md} (100%) rename files/es/web/api/indexeddb_api/using_indexeddb/{index.html => index.md} (100%) rename files/es/web/api/intersection_observer_api/{index.html => index.md} (100%) rename files/es/web/api/issecurecontext/{index.html => index.md} (100%) rename files/es/web/api/keyboardevent/{index.html => index.md} (100%) rename files/es/web/api/location/{index.html => index.md} (100%) rename files/es/web/api/location/origin/{index.html => index.md} (100%) rename files/es/web/api/location/reload/{index.html => index.md} (100%) rename files/es/web/api/media_capture_and_streams_api/{index.html => index.md} (100%) rename files/es/web/api/media_capture_and_streams_api/taking_still_photos/{index.html => index.md} (100%) rename files/es/web/api/mediadevices/getusermedia/{index.html => index.md} (100%) rename files/es/web/api/mediadevices/{index.html => index.md} (100%) rename files/es/web/api/mediaquerylist/addlistener/{index.html => index.md} (100%) rename files/es/web/api/mediaquerylist/{index.html => index.md} (100%) rename files/es/web/api/mediaquerylist/matches/{index.html => index.md} (100%) rename files/es/web/api/mediaquerylist/removelistener/{index.html => index.md} (100%) rename files/es/web/api/mediastreamtrack/{index.html => index.md} (100%) rename files/es/web/api/messageevent/{index.html => index.md} (100%) rename files/es/web/api/mimetype/{index.html => index.md} (100%) rename files/es/web/api/mouseevent/{index.html => index.md} (100%) rename files/es/web/api/mouseevent/initmouseevent/{index.html => index.md} (100%) rename files/es/web/api/mouseevent/pagex/{index.html => index.md} (100%) rename files/es/web/api/mouseevent/shiftkey/{index.html => index.md} (100%) rename files/es/web/api/mutationobserver/{index.html => index.md} (100%) rename files/es/web/api/mutationobserver/mutationobserver/{index.html => index.md} (100%) rename files/es/web/api/mutationobserver/observe/{index.html => index.md} (100%) rename files/es/web/api/network_information_api/{index.html => index.md} (100%) rename files/es/web/api/node/appendchild/{index.html => index.md} (100%) rename files/es/web/api/node/childnodes/{index.html => index.md} (100%) rename files/es/web/api/node/clonenode/{index.html => index.md} (100%) rename files/es/web/api/node/contains/{index.html => index.md} (100%) rename files/es/web/api/node/haschildnodes/{index.html => index.md} (100%) rename files/es/web/api/node/{index.html => index.md} (100%) rename files/es/web/api/node/insertbefore/{index.html => index.md} (100%) rename files/es/web/api/node/issamenode/{index.html => index.md} (100%) rename files/es/web/api/node/lastchild/{index.html => index.md} (100%) rename files/es/web/api/node/nextsibling/{index.html => index.md} (100%) rename files/es/web/api/node/nodename/{index.html => index.md} (100%) rename files/es/web/api/node/nodetype/{index.html => index.md} (100%) rename files/es/web/api/node/nodevalue/{index.html => index.md} (100%) rename files/es/web/api/node/ownerdocument/{index.html => index.md} (100%) rename files/es/web/api/node/parentelement/{index.html => index.md} (100%) rename files/es/web/api/node/parentnode/{index.html => index.md} (100%) rename files/es/web/api/node/previoussibling/{index.html => index.md} (100%) rename files/es/web/api/node/removechild/{index.html => index.md} (100%) rename files/es/web/api/node/replacechild/{index.html => index.md} (100%) rename files/es/web/api/node/selectstart_event/{index.html => index.md} (100%) rename files/es/web/api/node/textcontent/{index.html => index.md} (100%) rename files/es/web/api/nodelist/foreach/{index.html => index.md} (100%) rename files/es/web/api/nodelist/{index.html => index.md} (100%) rename files/es/web/api/notification/{index.html => index.md} (100%) rename files/es/web/api/notifications_api/{index.html => index.md} (100%) rename files/es/web/api/payment_request_api/{index.html => index.md} (100%) rename files/es/web/api/performance/clearmarks/{index.html => index.md} (100%) rename files/es/web/api/performance/clearmeasures/{index.html => index.md} (100%) rename files/es/web/api/performance/{index.html => index.md} (100%) rename files/es/web/api/performance/memory/{index.html => index.md} (100%) rename files/es/web/api/performance/navigation/{index.html => index.md} (100%) rename files/es/web/api/performance/now/{index.html => index.md} (100%) rename files/es/web/api/performance/timeorigin/{index.html => index.md} (100%) rename files/es/web/api/performance/timing/{index.html => index.md} (100%) rename files/es/web/api/performancenavigation/{index.html => index.md} (100%) rename files/es/web/api/pointer_lock_api/{index.html => index.md} (100%) rename files/es/web/api/push_api/{index.html => index.md} (100%) rename files/es/web/api/pushmanager/{index.html => index.md} (100%) rename files/es/web/api/pushmanager/supportedcontentencodings/{index.html => index.md} (100%) rename files/es/web/api/range/collapsed/{index.html => index.md} (100%) rename files/es/web/api/range/commonancestorcontainer/{index.html => index.md} (100%) rename files/es/web/api/range/getclientrects/{index.html => index.md} (100%) rename files/es/web/api/range/{index.html => index.md} (100%) rename files/es/web/api/range/setstart/{index.html => index.md} (100%) rename files/es/web/api/request/headers/{index.html => index.md} (100%) rename files/es/web/api/request/{index.html => index.md} (100%) rename files/es/web/api/response/{index.html => index.md} (100%) rename files/es/web/api/response/ok/{index.html => index.md} (100%) rename files/es/web/api/response/response/{index.html => index.md} (100%) rename files/es/web/api/response/status/{index.html => index.md} (100%) rename files/es/web/api/rtcpeerconnection/cantrickleicecandidates/{index.html => index.md} (100%) rename files/es/web/api/rtcpeerconnection/{index.html => index.md} (100%) rename files/es/web/api/rtcrtpreceiver/{index.html => index.md} (100%) diff --git a/files/es/web/api/idbcursor/continue/index.html b/files/es/web/api/idbcursor/continue/index.md similarity index 100% rename from files/es/web/api/idbcursor/continue/index.html rename to files/es/web/api/idbcursor/continue/index.md diff --git a/files/es/web/api/idbcursor/index.html b/files/es/web/api/idbcursor/index.md similarity index 100% rename from files/es/web/api/idbcursor/index.html rename to files/es/web/api/idbcursor/index.md diff --git a/files/es/web/api/idbdatabase/index.html b/files/es/web/api/idbdatabase/index.md similarity index 100% rename from files/es/web/api/idbdatabase/index.html rename to files/es/web/api/idbdatabase/index.md diff --git a/files/es/web/api/idbdatabase/transaction/index.html b/files/es/web/api/idbdatabase/transaction/index.md similarity index 100% rename from files/es/web/api/idbdatabase/transaction/index.html rename to files/es/web/api/idbdatabase/transaction/index.md diff --git a/files/es/web/api/idbobjectstore/add/index.html b/files/es/web/api/idbobjectstore/add/index.md similarity index 100% rename from files/es/web/api/idbobjectstore/add/index.html rename to files/es/web/api/idbobjectstore/add/index.md diff --git a/files/es/web/api/idbobjectstore/index.html b/files/es/web/api/idbobjectstore/index.md similarity index 100% rename from files/es/web/api/idbobjectstore/index.html rename to files/es/web/api/idbobjectstore/index.md diff --git a/files/es/web/api/imagebitmap/index.html b/files/es/web/api/imagebitmap/index.md similarity index 100% rename from files/es/web/api/imagebitmap/index.html rename to files/es/web/api/imagebitmap/index.md diff --git a/files/es/web/api/imagebitmaprenderingcontext/index.html b/files/es/web/api/imagebitmaprenderingcontext/index.md similarity index 100% rename from files/es/web/api/imagebitmaprenderingcontext/index.html rename to files/es/web/api/imagebitmaprenderingcontext/index.md diff --git a/files/es/web/api/index.html b/files/es/web/api/index.md similarity index 100% rename from files/es/web/api/index.html rename to files/es/web/api/index.md diff --git a/files/es/web/api/indexeddb/index.html b/files/es/web/api/indexeddb/index.md similarity index 100% rename from files/es/web/api/indexeddb/index.html rename to files/es/web/api/indexeddb/index.md diff --git a/files/es/web/api/indexeddb_api/index.html b/files/es/web/api/indexeddb_api/index.md similarity index 100% rename from files/es/web/api/indexeddb_api/index.html rename to files/es/web/api/indexeddb_api/index.md diff --git a/files/es/web/api/indexeddb_api/using_indexeddb/index.html b/files/es/web/api/indexeddb_api/using_indexeddb/index.md similarity index 100% rename from files/es/web/api/indexeddb_api/using_indexeddb/index.html rename to files/es/web/api/indexeddb_api/using_indexeddb/index.md diff --git a/files/es/web/api/intersection_observer_api/index.html b/files/es/web/api/intersection_observer_api/index.md similarity index 100% rename from files/es/web/api/intersection_observer_api/index.html rename to files/es/web/api/intersection_observer_api/index.md diff --git a/files/es/web/api/issecurecontext/index.html b/files/es/web/api/issecurecontext/index.md similarity index 100% rename from files/es/web/api/issecurecontext/index.html rename to files/es/web/api/issecurecontext/index.md diff --git a/files/es/web/api/keyboardevent/index.html b/files/es/web/api/keyboardevent/index.md similarity index 100% rename from files/es/web/api/keyboardevent/index.html rename to files/es/web/api/keyboardevent/index.md diff --git a/files/es/web/api/location/index.html b/files/es/web/api/location/index.md similarity index 100% rename from files/es/web/api/location/index.html rename to files/es/web/api/location/index.md diff --git a/files/es/web/api/location/origin/index.html b/files/es/web/api/location/origin/index.md similarity index 100% rename from files/es/web/api/location/origin/index.html rename to files/es/web/api/location/origin/index.md diff --git a/files/es/web/api/location/reload/index.html b/files/es/web/api/location/reload/index.md similarity index 100% rename from files/es/web/api/location/reload/index.html rename to files/es/web/api/location/reload/index.md diff --git a/files/es/web/api/media_capture_and_streams_api/index.html b/files/es/web/api/media_capture_and_streams_api/index.md similarity index 100% rename from files/es/web/api/media_capture_and_streams_api/index.html rename to files/es/web/api/media_capture_and_streams_api/index.md diff --git a/files/es/web/api/media_capture_and_streams_api/taking_still_photos/index.html b/files/es/web/api/media_capture_and_streams_api/taking_still_photos/index.md similarity index 100% rename from files/es/web/api/media_capture_and_streams_api/taking_still_photos/index.html rename to files/es/web/api/media_capture_and_streams_api/taking_still_photos/index.md diff --git a/files/es/web/api/mediadevices/getusermedia/index.html b/files/es/web/api/mediadevices/getusermedia/index.md similarity index 100% rename from files/es/web/api/mediadevices/getusermedia/index.html rename to files/es/web/api/mediadevices/getusermedia/index.md diff --git a/files/es/web/api/mediadevices/index.html b/files/es/web/api/mediadevices/index.md similarity index 100% rename from files/es/web/api/mediadevices/index.html rename to files/es/web/api/mediadevices/index.md diff --git a/files/es/web/api/mediaquerylist/addlistener/index.html b/files/es/web/api/mediaquerylist/addlistener/index.md similarity index 100% rename from files/es/web/api/mediaquerylist/addlistener/index.html rename to files/es/web/api/mediaquerylist/addlistener/index.md diff --git a/files/es/web/api/mediaquerylist/index.html b/files/es/web/api/mediaquerylist/index.md similarity index 100% rename from files/es/web/api/mediaquerylist/index.html rename to files/es/web/api/mediaquerylist/index.md diff --git a/files/es/web/api/mediaquerylist/matches/index.html b/files/es/web/api/mediaquerylist/matches/index.md similarity index 100% rename from files/es/web/api/mediaquerylist/matches/index.html rename to files/es/web/api/mediaquerylist/matches/index.md diff --git a/files/es/web/api/mediaquerylist/removelistener/index.html b/files/es/web/api/mediaquerylist/removelistener/index.md similarity index 100% rename from files/es/web/api/mediaquerylist/removelistener/index.html rename to files/es/web/api/mediaquerylist/removelistener/index.md diff --git a/files/es/web/api/mediastreamtrack/index.html b/files/es/web/api/mediastreamtrack/index.md similarity index 100% rename from files/es/web/api/mediastreamtrack/index.html rename to files/es/web/api/mediastreamtrack/index.md diff --git a/files/es/web/api/messageevent/index.html b/files/es/web/api/messageevent/index.md similarity index 100% rename from files/es/web/api/messageevent/index.html rename to files/es/web/api/messageevent/index.md diff --git a/files/es/web/api/mimetype/index.html b/files/es/web/api/mimetype/index.md similarity index 100% rename from files/es/web/api/mimetype/index.html rename to files/es/web/api/mimetype/index.md diff --git a/files/es/web/api/mouseevent/index.html b/files/es/web/api/mouseevent/index.md similarity index 100% rename from files/es/web/api/mouseevent/index.html rename to files/es/web/api/mouseevent/index.md diff --git a/files/es/web/api/mouseevent/initmouseevent/index.html b/files/es/web/api/mouseevent/initmouseevent/index.md similarity index 100% rename from files/es/web/api/mouseevent/initmouseevent/index.html rename to files/es/web/api/mouseevent/initmouseevent/index.md diff --git a/files/es/web/api/mouseevent/pagex/index.html b/files/es/web/api/mouseevent/pagex/index.md similarity index 100% rename from files/es/web/api/mouseevent/pagex/index.html rename to files/es/web/api/mouseevent/pagex/index.md diff --git a/files/es/web/api/mouseevent/shiftkey/index.html b/files/es/web/api/mouseevent/shiftkey/index.md similarity index 100% rename from files/es/web/api/mouseevent/shiftkey/index.html rename to files/es/web/api/mouseevent/shiftkey/index.md diff --git a/files/es/web/api/mutationobserver/index.html b/files/es/web/api/mutationobserver/index.md similarity index 100% rename from files/es/web/api/mutationobserver/index.html rename to files/es/web/api/mutationobserver/index.md diff --git a/files/es/web/api/mutationobserver/mutationobserver/index.html b/files/es/web/api/mutationobserver/mutationobserver/index.md similarity index 100% rename from files/es/web/api/mutationobserver/mutationobserver/index.html rename to files/es/web/api/mutationobserver/mutationobserver/index.md diff --git a/files/es/web/api/mutationobserver/observe/index.html b/files/es/web/api/mutationobserver/observe/index.md similarity index 100% rename from files/es/web/api/mutationobserver/observe/index.html rename to files/es/web/api/mutationobserver/observe/index.md diff --git a/files/es/web/api/network_information_api/index.html b/files/es/web/api/network_information_api/index.md similarity index 100% rename from files/es/web/api/network_information_api/index.html rename to files/es/web/api/network_information_api/index.md diff --git a/files/es/web/api/node/appendchild/index.html b/files/es/web/api/node/appendchild/index.md similarity index 100% rename from files/es/web/api/node/appendchild/index.html rename to files/es/web/api/node/appendchild/index.md diff --git a/files/es/web/api/node/childnodes/index.html b/files/es/web/api/node/childnodes/index.md similarity index 100% rename from files/es/web/api/node/childnodes/index.html rename to files/es/web/api/node/childnodes/index.md diff --git a/files/es/web/api/node/clonenode/index.html b/files/es/web/api/node/clonenode/index.md similarity index 100% rename from files/es/web/api/node/clonenode/index.html rename to files/es/web/api/node/clonenode/index.md diff --git a/files/es/web/api/node/contains/index.html b/files/es/web/api/node/contains/index.md similarity index 100% rename from files/es/web/api/node/contains/index.html rename to files/es/web/api/node/contains/index.md diff --git a/files/es/web/api/node/haschildnodes/index.html b/files/es/web/api/node/haschildnodes/index.md similarity index 100% rename from files/es/web/api/node/haschildnodes/index.html rename to files/es/web/api/node/haschildnodes/index.md diff --git a/files/es/web/api/node/index.html b/files/es/web/api/node/index.md similarity index 100% rename from files/es/web/api/node/index.html rename to files/es/web/api/node/index.md diff --git a/files/es/web/api/node/insertbefore/index.html b/files/es/web/api/node/insertbefore/index.md similarity index 100% rename from files/es/web/api/node/insertbefore/index.html rename to files/es/web/api/node/insertbefore/index.md diff --git a/files/es/web/api/node/issamenode/index.html b/files/es/web/api/node/issamenode/index.md similarity index 100% rename from files/es/web/api/node/issamenode/index.html rename to files/es/web/api/node/issamenode/index.md diff --git a/files/es/web/api/node/lastchild/index.html b/files/es/web/api/node/lastchild/index.md similarity index 100% rename from files/es/web/api/node/lastchild/index.html rename to files/es/web/api/node/lastchild/index.md diff --git a/files/es/web/api/node/nextsibling/index.html b/files/es/web/api/node/nextsibling/index.md similarity index 100% rename from files/es/web/api/node/nextsibling/index.html rename to files/es/web/api/node/nextsibling/index.md diff --git a/files/es/web/api/node/nodename/index.html b/files/es/web/api/node/nodename/index.md similarity index 100% rename from files/es/web/api/node/nodename/index.html rename to files/es/web/api/node/nodename/index.md diff --git a/files/es/web/api/node/nodetype/index.html b/files/es/web/api/node/nodetype/index.md similarity index 100% rename from files/es/web/api/node/nodetype/index.html rename to files/es/web/api/node/nodetype/index.md diff --git a/files/es/web/api/node/nodevalue/index.html b/files/es/web/api/node/nodevalue/index.md similarity index 100% rename from files/es/web/api/node/nodevalue/index.html rename to files/es/web/api/node/nodevalue/index.md diff --git a/files/es/web/api/node/ownerdocument/index.html b/files/es/web/api/node/ownerdocument/index.md similarity index 100% rename from files/es/web/api/node/ownerdocument/index.html rename to files/es/web/api/node/ownerdocument/index.md diff --git a/files/es/web/api/node/parentelement/index.html b/files/es/web/api/node/parentelement/index.md similarity index 100% rename from files/es/web/api/node/parentelement/index.html rename to files/es/web/api/node/parentelement/index.md diff --git a/files/es/web/api/node/parentnode/index.html b/files/es/web/api/node/parentnode/index.md similarity index 100% rename from files/es/web/api/node/parentnode/index.html rename to files/es/web/api/node/parentnode/index.md diff --git a/files/es/web/api/node/previoussibling/index.html b/files/es/web/api/node/previoussibling/index.md similarity index 100% rename from files/es/web/api/node/previoussibling/index.html rename to files/es/web/api/node/previoussibling/index.md diff --git a/files/es/web/api/node/removechild/index.html b/files/es/web/api/node/removechild/index.md similarity index 100% rename from files/es/web/api/node/removechild/index.html rename to files/es/web/api/node/removechild/index.md diff --git a/files/es/web/api/node/replacechild/index.html b/files/es/web/api/node/replacechild/index.md similarity index 100% rename from files/es/web/api/node/replacechild/index.html rename to files/es/web/api/node/replacechild/index.md diff --git a/files/es/web/api/node/selectstart_event/index.html b/files/es/web/api/node/selectstart_event/index.md similarity index 100% rename from files/es/web/api/node/selectstart_event/index.html rename to files/es/web/api/node/selectstart_event/index.md diff --git a/files/es/web/api/node/textcontent/index.html b/files/es/web/api/node/textcontent/index.md similarity index 100% rename from files/es/web/api/node/textcontent/index.html rename to files/es/web/api/node/textcontent/index.md diff --git a/files/es/web/api/nodelist/foreach/index.html b/files/es/web/api/nodelist/foreach/index.md similarity index 100% rename from files/es/web/api/nodelist/foreach/index.html rename to files/es/web/api/nodelist/foreach/index.md diff --git a/files/es/web/api/nodelist/index.html b/files/es/web/api/nodelist/index.md similarity index 100% rename from files/es/web/api/nodelist/index.html rename to files/es/web/api/nodelist/index.md diff --git a/files/es/web/api/notification/index.html b/files/es/web/api/notification/index.md similarity index 100% rename from files/es/web/api/notification/index.html rename to files/es/web/api/notification/index.md diff --git a/files/es/web/api/notifications_api/index.html b/files/es/web/api/notifications_api/index.md similarity index 100% rename from files/es/web/api/notifications_api/index.html rename to files/es/web/api/notifications_api/index.md diff --git a/files/es/web/api/payment_request_api/index.html b/files/es/web/api/payment_request_api/index.md similarity index 100% rename from files/es/web/api/payment_request_api/index.html rename to files/es/web/api/payment_request_api/index.md diff --git a/files/es/web/api/performance/clearmarks/index.html b/files/es/web/api/performance/clearmarks/index.md similarity index 100% rename from files/es/web/api/performance/clearmarks/index.html rename to files/es/web/api/performance/clearmarks/index.md diff --git a/files/es/web/api/performance/clearmeasures/index.html b/files/es/web/api/performance/clearmeasures/index.md similarity index 100% rename from files/es/web/api/performance/clearmeasures/index.html rename to files/es/web/api/performance/clearmeasures/index.md diff --git a/files/es/web/api/performance/index.html b/files/es/web/api/performance/index.md similarity index 100% rename from files/es/web/api/performance/index.html rename to files/es/web/api/performance/index.md diff --git a/files/es/web/api/performance/memory/index.html b/files/es/web/api/performance/memory/index.md similarity index 100% rename from files/es/web/api/performance/memory/index.html rename to files/es/web/api/performance/memory/index.md diff --git a/files/es/web/api/performance/navigation/index.html b/files/es/web/api/performance/navigation/index.md similarity index 100% rename from files/es/web/api/performance/navigation/index.html rename to files/es/web/api/performance/navigation/index.md diff --git a/files/es/web/api/performance/now/index.html b/files/es/web/api/performance/now/index.md similarity index 100% rename from files/es/web/api/performance/now/index.html rename to files/es/web/api/performance/now/index.md diff --git a/files/es/web/api/performance/timeorigin/index.html b/files/es/web/api/performance/timeorigin/index.md similarity index 100% rename from files/es/web/api/performance/timeorigin/index.html rename to files/es/web/api/performance/timeorigin/index.md diff --git a/files/es/web/api/performance/timing/index.html b/files/es/web/api/performance/timing/index.md similarity index 100% rename from files/es/web/api/performance/timing/index.html rename to files/es/web/api/performance/timing/index.md diff --git a/files/es/web/api/performancenavigation/index.html b/files/es/web/api/performancenavigation/index.md similarity index 100% rename from files/es/web/api/performancenavigation/index.html rename to files/es/web/api/performancenavigation/index.md diff --git a/files/es/web/api/pointer_lock_api/index.html b/files/es/web/api/pointer_lock_api/index.md similarity index 100% rename from files/es/web/api/pointer_lock_api/index.html rename to files/es/web/api/pointer_lock_api/index.md diff --git a/files/es/web/api/push_api/index.html b/files/es/web/api/push_api/index.md similarity index 100% rename from files/es/web/api/push_api/index.html rename to files/es/web/api/push_api/index.md diff --git a/files/es/web/api/pushmanager/index.html b/files/es/web/api/pushmanager/index.md similarity index 100% rename from files/es/web/api/pushmanager/index.html rename to files/es/web/api/pushmanager/index.md diff --git a/files/es/web/api/pushmanager/supportedcontentencodings/index.html b/files/es/web/api/pushmanager/supportedcontentencodings/index.md similarity index 100% rename from files/es/web/api/pushmanager/supportedcontentencodings/index.html rename to files/es/web/api/pushmanager/supportedcontentencodings/index.md diff --git a/files/es/web/api/range/collapsed/index.html b/files/es/web/api/range/collapsed/index.md similarity index 100% rename from files/es/web/api/range/collapsed/index.html rename to files/es/web/api/range/collapsed/index.md diff --git a/files/es/web/api/range/commonancestorcontainer/index.html b/files/es/web/api/range/commonancestorcontainer/index.md similarity index 100% rename from files/es/web/api/range/commonancestorcontainer/index.html rename to files/es/web/api/range/commonancestorcontainer/index.md diff --git a/files/es/web/api/range/getclientrects/index.html b/files/es/web/api/range/getclientrects/index.md similarity index 100% rename from files/es/web/api/range/getclientrects/index.html rename to files/es/web/api/range/getclientrects/index.md diff --git a/files/es/web/api/range/index.html b/files/es/web/api/range/index.md similarity index 100% rename from files/es/web/api/range/index.html rename to files/es/web/api/range/index.md diff --git a/files/es/web/api/range/setstart/index.html b/files/es/web/api/range/setstart/index.md similarity index 100% rename from files/es/web/api/range/setstart/index.html rename to files/es/web/api/range/setstart/index.md diff --git a/files/es/web/api/request/headers/index.html b/files/es/web/api/request/headers/index.md similarity index 100% rename from files/es/web/api/request/headers/index.html rename to files/es/web/api/request/headers/index.md diff --git a/files/es/web/api/request/index.html b/files/es/web/api/request/index.md similarity index 100% rename from files/es/web/api/request/index.html rename to files/es/web/api/request/index.md diff --git a/files/es/web/api/response/index.html b/files/es/web/api/response/index.md similarity index 100% rename from files/es/web/api/response/index.html rename to files/es/web/api/response/index.md diff --git a/files/es/web/api/response/ok/index.html b/files/es/web/api/response/ok/index.md similarity index 100% rename from files/es/web/api/response/ok/index.html rename to files/es/web/api/response/ok/index.md diff --git a/files/es/web/api/response/response/index.html b/files/es/web/api/response/response/index.md similarity index 100% rename from files/es/web/api/response/response/index.html rename to files/es/web/api/response/response/index.md diff --git a/files/es/web/api/response/status/index.html b/files/es/web/api/response/status/index.md similarity index 100% rename from files/es/web/api/response/status/index.html rename to files/es/web/api/response/status/index.md diff --git a/files/es/web/api/rtcpeerconnection/cantrickleicecandidates/index.html b/files/es/web/api/rtcpeerconnection/cantrickleicecandidates/index.md similarity index 100% rename from files/es/web/api/rtcpeerconnection/cantrickleicecandidates/index.html rename to files/es/web/api/rtcpeerconnection/cantrickleicecandidates/index.md diff --git a/files/es/web/api/rtcpeerconnection/index.html b/files/es/web/api/rtcpeerconnection/index.md similarity index 100% rename from files/es/web/api/rtcpeerconnection/index.html rename to files/es/web/api/rtcpeerconnection/index.md diff --git a/files/es/web/api/rtcrtpreceiver/index.html b/files/es/web/api/rtcrtpreceiver/index.md similarity index 100% rename from files/es/web/api/rtcrtpreceiver/index.html rename to files/es/web/api/rtcrtpreceiver/index.md From 978a2bedf019067c9b877617cd26a458519326a6 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 25 Oct 2022 16:40:20 -0500 Subject: [PATCH 3/7] api/i-r h2m replace --- files/es/web/api/idbcursor/continue/index.md | 103 +-- files/es/web/api/idbcursor/index.md | 132 ++- files/es/web/api/idbdatabase/index.md | 179 ++-- .../web/api/idbdatabase/transaction/index.md | 202 ++--- files/es/web/api/idbobjectstore/add/index.md | 154 ++-- files/es/web/api/idbobjectstore/index.md | 167 ++-- files/es/web/api/imagebitmap/index.md | 65 +- .../api/imagebitmaprenderingcontext/index.md | 34 +- files/es/web/api/index.md | 27 +- files/es/web/api/indexeddb/index.md | 67 +- files/es/web/api/indexeddb_api/index.md | 94 +- .../indexeddb_api/using_indexeddb/index.md | 818 +++++++++--------- .../api/intersection_observer_api/index.md | 472 +++++----- files/es/web/api/issecurecontext/index.md | 36 +- files/es/web/api/keyboardevent/index.md | 375 ++++---- files/es/web/api/location/index.md | 118 ++- files/es/web/api/location/origin/index.md | 53 +- files/es/web/api/location/reload/index.md | 85 +- .../media_capture_and_streams_api/index.md | 476 +++++----- .../taking_still_photos/index.md | 144 +-- .../api/mediadevices/getusermedia/index.md | 225 ++--- files/es/web/api/mediadevices/index.md | 65 +- .../api/mediaquerylist/addlistener/index.md | 70 +- files/es/web/api/mediaquerylist/index.md | 96 +- .../web/api/mediaquerylist/matches/index.md | 62 +- .../mediaquerylist/removelistener/index.md | 72 +- files/es/web/api/mediastreamtrack/index.md | 153 ++-- files/es/web/api/messageevent/index.md | 136 ++- files/es/web/api/mimetype/index.md | 45 +- files/es/web/api/mouseevent/index.md | 299 +++---- .../api/mouseevent/initmouseevent/index.md | 103 ++- files/es/web/api/mouseevent/pagex/index.md | 104 ++- files/es/web/api/mouseevent/shiftkey/index.md | 83 +- files/es/web/api/mutationobserver/index.md | 304 +++---- .../mutationobserver/index.md | 84 +- .../web/api/mutationobserver/observe/index.md | 100 +-- .../web/api/network_information_api/index.md | 84 +- files/es/web/api/node/appendchild/index.md | 133 ++- files/es/web/api/node/childnodes/index.md | 118 +-- files/es/web/api/node/clonenode/index.md | 119 +-- files/es/web/api/node/contains/index.md | 66 +- files/es/web/api/node/haschildnodes/index.md | 68 +- files/es/web/api/node/index.md | 393 ++++----- files/es/web/api/node/insertbefore/index.md | 171 ++-- files/es/web/api/node/issamenode/index.md | 86 +- files/es/web/api/node/lastchild/index.md | 63 +- files/es/web/api/node/nextsibling/index.md | 65 +- files/es/web/api/node/nodename/index.md | 147 ++-- files/es/web/api/node/nodetype/index.md | 108 +-- files/es/web/api/node/nodevalue/index.md | 96 +- files/es/web/api/node/ownerdocument/index.md | 56 +- files/es/web/api/node/parentelement/index.md | 40 +- files/es/web/api/node/parentnode/index.md | 58 +- .../es/web/api/node/previoussibling/index.md | 67 +- files/es/web/api/node/removechild/index.md | 150 ++-- files/es/web/api/node/replacechild/index.md | 54 +- .../web/api/node/selectstart_event/index.md | 51 +- files/es/web/api/node/textcontent/index.md | 109 +-- files/es/web/api/nodelist/foreach/index.md | 130 ++- files/es/web/api/nodelist/index.md | 134 ++- files/es/web/api/notification/index.md | 365 ++++---- files/es/web/api/notifications_api/index.md | 87 +- files/es/web/api/payment_request_api/index.md | 204 ++--- .../web/api/performance/clearmarks/index.md | 75 +- .../api/performance/clearmeasures/index.md | 75 +- files/es/web/api/performance/index.md | 203 ++--- files/es/web/api/performance/memory/index.md | 44 +- .../web/api/performance/navigation/index.md | 49 +- files/es/web/api/performance/now/index.md | 62 +- .../web/api/performance/timeorigin/index.md | 41 +- files/es/web/api/performance/timing/index.md | 49 +- .../es/web/api/performancenavigation/index.md | 85 +- files/es/web/api/pointer_lock_api/index.md | 147 ++-- files/es/web/api/push_api/index.md | 107 +-- files/es/web/api/pushmanager/index.md | 95 +- .../supportedcontentencodings/index.md | 43 +- files/es/web/api/range/collapsed/index.md | 32 +- .../range/commonancestorcontainer/index.md | 32 +- .../es/web/api/range/getclientrects/index.md | 51 +- files/es/web/api/range/index.md | 190 ++-- files/es/web/api/range/setstart/index.md | 77 +- files/es/web/api/request/headers/index.md | 67 +- files/es/web/api/request/index.md | 223 +++-- files/es/web/api/response/index.md | 187 ++-- files/es/web/api/response/ok/index.md | 63 +- files/es/web/api/response/response/index.md | 110 +-- files/es/web/api/response/status/index.md | 61 +- .../cantrickleicecandidates/index.md | 82 +- files/es/web/api/rtcpeerconnection/index.md | 393 +++------ files/es/web/api/rtcrtpreceiver/index.md | 87 +- 90 files changed, 5037 insertions(+), 6717 deletions(-) diff --git a/files/es/web/api/idbcursor/continue/index.md b/files/es/web/api/idbcursor/continue/index.md index 8c313e7d3750ab..a6aa1c6a4b10ea 100644 --- a/files/es/web/api/idbcursor/continue/index.md +++ b/files/es/web/api/idbcursor/continue/index.md @@ -12,45 +12,46 @@ tags: - metodo translation_of: Web/API/IDBCursor/continue --- -

{{APIRef("IndexedDB")}}

+{{APIRef("IndexedDB")}} -

El siguiente() método de la {{domxref("IDBCursor")}} interfaz, avanza el cursor hacia la siguiente posición a lo largo de su dirección, para el elemento cuya tecla marque la opción de una tecla parámetro. si ninguna tecla es especificada, el cursor avanzará hacia la siguiente posición, bazado en su dirección actual.

+**`El siguiente()`** método de la {{domxref("IDBCursor")}} interfaz, avanza el cursor hacia la siguiente posición a lo largo de su dirección, para el elemento cuya tecla marque la opción de una tecla parámetro. si ninguna tecla es especificada, el cursor avanzará hacia la siguiente posición, bazado en su dirección actual. -

{{AvailableInWorkers}}

+{{AvailableInWorkers}} -

Sintaxis

+## Sintaxis -
cursor.continue(optionalKey);
+```js +cursor.continue(optionalKey); +``` -

Parámetros

+### Parámetros -
-
Tecla opcional
-
La tecla para posisionar al cursor en.
-
+- _Tecla opcional_ + - : La tecla para posisionar al cursor en. -

Excepciones

+### Excepciones -

Este método puede plantear un{{domxref("DOMException")}} con una {{domxref("DOMError")}} de uno de los siguientes tipos:

+Este método puede plantear un{{domxref("DOMException")}} con una {{domxref("DOMError")}} de uno de los siguientes tipos: -
-
TransactionInactiveError
Esta transacción en el Cursor IDB está inactiva.
DataError
-

El parámetro de una tecla podría tener una de las siguientes condiciones:

+- `TransactionInactiveError` + - : Esta transacción en el Cursor IDB está inactiva. +- `DataError` -
    -
  • La tecla no es una tecla valida.
  • -
  • La tecla está más atrás o en el mismo sitio que la posición del cursor y además la dirección del cursor es la siguiente o la única siguiente.
  • -
  • La tecla está más adelante o en el mismo sitio que la posición del cursor y además la dirección del cursor es previa o la única previa.
  • -
-
InvalidStateError
El cursor está siendo reiterado o se ha reiterado mas allá de su final.
-
-
+ - : El parámetro de una tecla podría tener una de las siguientes condiciones: -

Ejemplo

+ - La tecla no es una tecla valida. + - La tecla está más atrás o en el mismo sitio que la posición del cursor y además la dirección del cursor es la siguiente o la única siguiente. + - La tecla está más adelante o en el mismo sitio que la posición del cursor y además la dirección del cursor es previa o la única previa. -

En este simple fragmento nosotros creamos una transacción, recuperar un objeto del almacen, despues usamos un cursor para interactuar a traves de todos los registros en almacen de objetos. El cursor no requiere que nosotros seleccionemos los datos basados en una tecla; podemos tomarlo todo. También es importante resaltar que en cada interacción de la cadena, puedes tomar datos desde el registro actual debajo del objeto del cursor usando cursor.value.foo. Para dar un ejemplo completo, puedes mirar nuestra IDBCursor example (view example live.)

+- `InvalidStateError` + - : El cursor está siendo reiterado o se ha reiterado mas allá de su final. -
function displayData() {
+## Ejemplo
+
+En este simple fragmento nosotros creamos una transacción, recuperar un objeto del almacen, despues usamos un cursor para interactuar a traves de todos los registros en almacen de objetos. El cursor no requiere que nosotros seleccionemos los datos basados en una tecla; podemos tomarlo todo. También es importante resaltar que en cada interacción de la cadena, puedes tomar datos desde el registro actual debajo del objeto del cursor usando` ``cursor.value.foo`. Para dar un ejemplo completo, puedes mirar nuestra [IDBCursor example](https://mdn.github.io/dom-examples/indexeddb-examples/idbcursor/) ([view example live](https://mdn.github.io/dom-examples/indexeddb-examples/idbcursor/).)
+
+```
+function displayData() {
   var transaction = db.transaction(['rushAlbumList'], "readonly");
   var objectStore = transaction.objectStore('rushAlbumList');
 
@@ -66,39 +67,25 @@ translation_of: Web/API/IDBCursor/continue
       console.log('Entries all displayed.');
     }
   };
-};
- -

Especificaciones

- -
Especificación

The connection is closed.

-
+

This value moved into the RTCPeerConnectionState enum in the May 13, 2016 draft of the specification, as it reflects the state of the RTCPeerConnection, not the signaling connection. You now detect a closed connection by checking for {{domxref("RTCPeerConnection.connectionState", "connectionState")}} to be "closed" instead.

- - - - - - - - - - - - -
SpecificationEstadoComentarios
{{SpecName('IndexedDB', '#widl-IDBCursor-continue-void-any-key', 'continue()')}}{{Spec2('IndexedDB')}}
- -

Compatibilidad del navegador

+}; +``` -{{Compat("api.IDBCursor.continue")}} +## Especificaciones -

Te puede interesar

+| Specification | Estado | Comentarios | +| ------------------------------------------------------------------------------------------------------------ | ---------------------------- | ----------- | +| {{SpecName('IndexedDB', '#widl-IDBCursor-continue-void-any-key', 'continue()')}} | {{Spec2('IndexedDB')}} | | + +## Compatibilidad del navegador + +{{Compat("api.IDBCursor.continue")}} -
    -
  • Using IndexedDB
  • -
  • Starting transactions: {{domxref("IDBDatabase")}}
  • -
  • Using transactions: {{domxref("IDBTransaction")}}
  • -
  • Setting a range of keys: {{domxref("IDBKeyRange")}}
  • -
  • Retrieving and making changes to your data: {{domxref("IDBObjectStore")}}
  • -
  • Using cursors: {{domxref("IDBCursor")}}
  • -
  • Reference example: To-do Notifications (view example live.)
  • -
+## Te puede interesar -

+- [Using IndexedDB](/es/docs/Web/API/IndexedDB_API/Using_IndexedDB) +- Starting transactions: {{domxref("IDBDatabase")}} +- Using transactions: {{domxref("IDBTransaction")}} +- Setting a range of keys: {{domxref("IDBKeyRange")}} +- Retrieving and making changes to your data: {{domxref("IDBObjectStore")}} +- Using cursors: {{domxref("IDBCursor")}} +- Reference example: [To-do Notifications](https://github.com/mdn/to-do-notifications/tree/gh-pages) ([view example live](http://mdn.github.io/to-do-notifications/).) diff --git a/files/es/web/api/idbcursor/index.md b/files/es/web/api/idbcursor/index.md index 97cba4d36d019a..8d95d36aeb6735 100644 --- a/files/es/web/api/idbcursor/index.md +++ b/files/es/web/api/idbcursor/index.md @@ -14,65 +14,61 @@ tags: - TopicStub translation_of: Web/API/IDBCursor --- -

{{APIRef("IndexedDB")}}

+{{APIRef("IndexedDB")}} -

La interfaz IDBCursor de la IndexedDB API representa un cursor para atravesar o iterar varios registros de una base de datos.

+La interfaz **`IDBCursor`** de la [IndexedDB API](/es/docs/IndexedDB) representa un [cursor](/es/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_cursor) para atravesar o iterar varios registros de una base de datos. -

El cursor tiene una fuente que indica el índice o el almacén de objetos sobre el que se está iterando. Tiene una posición dentro del rango y se mueve en una dirección que aumenta o disminuye en el orden de las Keys de registro. El cursor permite a una aplicación procesar asincrónicamente todos los registros del rango del cursor.

+El cursor tiene una fuente que indica el índice o el almacén de objetos sobre el que se está iterando. Tiene una posición dentro del rango y se mueve en una dirección que aumenta o disminuye en el orden de las Keys de registro. El cursor permite a una aplicación procesar asincrónicamente todos los registros del rango del cursor. -

Puede tener un número ilimitado de cursores al mismo tiempo. Siempre se obtiene el mismo objeto IDBCursor que representa un cursor determinado. Las operaciones se realizan en el índice subyacente o en el almacén de objetos.

+Puede tener un número ilimitado de cursores al mismo tiempo. Siempre se obtiene el mismo objeto `IDBCursor` que representa un cursor determinado. Las operaciones se realizan en el índice subyacente o en el almacén de objetos. -

{{AvailableInWorkers}}

+{{AvailableInWorkers}} -

Methods

+## Methods -
-
{{domxref("IDBCursor.advance()")}}
-
Establece el número de veces que un cursor debe mover su posición hacia adelante.
-
{{domxref("IDBCursor.continue()")}}
-
Avanza el cursor a la siguiente posición a lo largo de su dirección, hasta el elemento cuya key coincide con el parámetro clave opcional.
-
+- {{domxref("IDBCursor.advance()")}} + - : Establece el número de veces que un cursor debe mover su posición hacia adelante. +- {{domxref("IDBCursor.continue()")}} + - : Avanza el cursor a la siguiente posición a lo largo de su dirección, hasta el elemento cuya `key` coincide con el parámetro clave opcional. -
-
{{domxref("IDBCursor.delete()")}}
-
Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, elimina el registro en la posición del cursor, sin cambiar la posición del cursor. Esto se puede utilizar para borrar registros específicos.

- {{domxref("IDBCursor.update()")}}

- Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, actualiza el valor en la posición actual del cursor en el almacén de objetos. Esto se puede utilizar para actualizar registros específicos.
-
+ -

Propiedades

+- {{domxref("IDBCursor.delete()")}} -
-
{{domxref("IDBCursor.source")}} {{readonlyInline}}
-
Devuelve {{domxref("IDBObjectStore")}} o {{domxref("IDBIndex")}}} que el cursor está iterando. Esta función nunca devuelve nulo o lanza una excepción, incluso si el cursor está siendo iterado, ha iterado más allá de su final, o su transacción no está activa.
-
{{domxref("IDBCursor.direction")}} {{readonlyInline}}
-
Devuelve la dirección de desplazamiento del cursor. Ver Constants para valores posibles.
-
{{domxref("IDBCursor.key")}} {{readonlyInline}}
-
Devuelve la key del registro en la posición del cursor. Si el cursor está fuera de su rango, se fija en undefined. La key del cursor puede ser de cualquier tipo de datos.
-
{{domxref("IDBCursor.primaryKey")}} {{readonlyInline}}
-
Devuelve la key primaria efectiva actual del cursor. Si el cursor está siendo iterado o ha iterado fuera de su rango, se fija en undefined. La key principal del cursor puede ser cualquier tipo de datos.
-
+ - : Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, elimina el registro en la posición del cursor, sin cambiar la posición del cursor. Esto se puede utilizar para borrar registros específicos. -

Constants

+ {{domxref("IDBCursor.update()")}} -
{{ deprecated_header(13) }}
+ Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, actualiza el valor en la posición actual del cursor en el almacén de objetos. Esto se puede utilizar para actualizar registros específicos. -
-

These constants are no longer available — they were removed in Gecko 25. You should use the string constants directly instead. ({{ bug(891944) }})

-
+## Propiedades -
    -
  • NEXT : "next" : The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves upwards (monotonically increasing in the order of keys).
  • -
  • NEXTUNIQUE : "nextunique" : The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the lower bound of the key range and moves upwards.
  • -
  • PREV : "prev" : The cursor shows all records, including duplicates. It starts at the upper bound of the key range and moves downwards (monotonically decreasing in the order of keys).
  • -
  • PREVUNIQUE : "prevunique" : The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the upper bound of the key range and moves downwards.
  • -
+- {{domxref("IDBCursor.source")}} {{readonlyInline}} + - : Devuelve {{domxref("IDBObjectStore")}} o {{domxref("IDBIndex")}}} que el cursor está iterando. Esta función nunca devuelve nulo o lanza una excepción, incluso si el cursor está siendo iterado, ha iterado más allá de su final, o su transacción no está activa. +- {{domxref("IDBCursor.direction")}} {{readonlyInline}} + - : Devuelve la dirección de desplazamiento del cursor. Ver [Constants](#const_next) para valores posibles. +- {{domxref("IDBCursor.key")}} {{readonlyInline}} + - : Devuelve la `key` del registro en la posición del cursor. Si el cursor está fuera de su rango, se fija en `undefined`. La `key` del cursor puede ser de cualquier tipo de datos. +- {{domxref("IDBCursor.primaryKey")}} {{readonlyInline}} + - : Devuelve la `key` primaria efectiva actual del cursor. Si el cursor está siendo iterado o ha iterado fuera de su rango, se fija en `undefined`. La `key` principal del cursor puede ser cualquier tipo de datos. -

Ejemplo

+## Constants -

En este simple fragmento creamos una transacción, recuperamos un almacén de objetos y usamos un cursor para iterar todos los registros del almacén de objetos. El cursor no nos obliga a seleccionar los datos en base a una key; podemos simplemente cogerlos todos. También tenga en cuenta que en cada iteración del bucle, puede tomar datos del registro actual bajo el objeto del cursor utilizando cursor.value.foo. Para un ejemplo completo de funcionamiento, vea nuestro IDBCursor example (view example live.)

+{{ deprecated_header(13) }} -
function displayData() {
+> **Advertencia:** These constants are no longer available — they were removed in Gecko 25. You should use the string constants directly instead. ({{ bug(891944) }})
+
+- `NEXT `: `"next"` : The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves upwards (monotonically increasing in the order of keys).
+- `NEXTUNIQUE` : `"nextunique"` : The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the lower bound of the key range and moves upwards.
+- `PREV `: `"prev"` : The cursor shows all records, including duplicates. It starts at the upper bound of the key range and moves downwards (monotonically decreasing in the order of keys).
+- `PREVUNIQUE `: `"prevunique"` : The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the upper bound of the key range and moves downwards.
+
+## Ejemplo
+
+En este simple fragmento creamos una transacción, recuperamos un almacén de objetos y usamos un cursor para iterar todos los registros del almacén de objetos. El cursor no nos obliga a seleccionar los datos en base a una `key`; podemos simplemente cogerlos todos. También tenga en cuenta que en cada iteración del bucle, puede tomar datos del registro actual bajo el objeto del cursor utilizando `cursor.value.foo`. Para un ejemplo completo de funcionamiento, vea nuestro [IDBCursor example](https://mdn.github.io/dom-examples/indexeddb-examples/idbcursor/) ([view example live](https://mdn.github.io/dom-examples/indexeddb-examples/idbcursor/).)
+
+```js
+function displayData() {
   var transaction = db.transaction(['rushAlbumList'], "readonly");
   var objectStore = transaction.objectStore('rushAlbumList');
 
@@ -88,37 +84,25 @@ translation_of: Web/API/IDBCursor
       console.log('Entries all displayed.');
     }
   };
-}
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('IndexedDB', '#idl-def-IDBCursor', 'cursor')}}{{Spec2('IndexedDB')}}
- -

Browser compatibility

+} +``` + +## Specifications + +| Specification | Status | Comment | +| ---------------------------------------------------------------------------- | ---------------------------- | ------- | +| {{SpecName('IndexedDB', '#idl-def-IDBCursor', 'cursor')}} | {{Spec2('IndexedDB')}} | | + +## Browser compatibility {{Compat("api.IDBCursor")}} -

See also

- -
    -
  • Using IndexedDB
  • -
  • Starting transactions: {{domxref("IDBDatabase")}}
  • -
  • Using transactions: {{domxref("IDBTransaction")}}
  • -
  • Setting a range of keys: {{domxref("IDBKeyRange")}}
  • -
  • Retrieving and making changes to your data: {{domxref("IDBObjectStore")}}
  • -
  • Using cursors: {{domxref("IDBCursor")}}
  • -
  • Reference example: To-do Notifications (view example live.)
  • -
+## See also + +- [Using IndexedDB](/es/docs/Web/API/IndexedDB_API/Using_IndexedDB) +- Starting transactions: {{domxref("IDBDatabase")}} +- Using transactions: {{domxref("IDBTransaction")}} +- Setting a range of keys: {{domxref("IDBKeyRange")}} +- Retrieving and making changes to your data: {{domxref("IDBObjectStore")}} +- Using cursors: {{domxref("IDBCursor")}} +- Reference example: [To-do Notifications](https://github.com/mdn/to-do-notifications/tree/gh-pages) ([view example live](http://mdn.github.io/to-do-notifications/).) diff --git a/files/es/web/api/idbdatabase/index.md b/files/es/web/api/idbdatabase/index.md index b6ce40a02cf80c..752ccb392775f1 100644 --- a/files/es/web/api/idbdatabase/index.md +++ b/files/es/web/api/idbdatabase/index.md @@ -16,73 +16,62 @@ tags: - transactions translation_of: Web/API/IDBDatabase --- -

{{APIRef("IndexedDB")}}

- -
-

The IDBDatabase interface of the IndexedDB API provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database.

- -

{{AvailableInWorkers}}

-
- -
-

Note: Everything you do in IndexedDB always happens in the context of a transaction, representing interactions with data in the database. All objects in IndexedDB — including object stores, indexes, and cursors — are tied to a particular transaction. Thus, you cannot execute commands, access data, or open anything outside of a transaction.

-
- -

Methods

- -

Inherits from: EventTarget

- -
-
{{domxref("IDBDatabase.close()")}}
-
Returns immediately and closes the connection to a database in a separate thread.
-
{{domxref("IDBDatabase.createObjectStore()")}}
-
Creates and returns a new object store or index.
-
{{domxref("IDBDatabase.deleteObjectStore()")}}
-
Destroys the object store with the given name in the connected database, along with any indexes that reference it.
-
{{domxref("IDBDatabase.transaction()")}}
-
Immediately returns a transaction object ({{domxref("IDBTransaction")}}) containing the {{domxref("IDBTransaction.objectStore")}} method, which you can use to access your object store. Runs in a separate thread.
-
- -

Properties

- -
-
{{domxref("IDBDatabase.name")}} {{readonlyInline}}
-
A {{ domxref("DOMString") }} that contains the name of the connected database.
-
{{domxref("IDBDatabase.version")}} {{readonlyInline}}
-
A 64-bit integer that contains the version of the connected database. When a database is first created, this attribute is an empty string.
-
{{domxref("IDBDatabase.objectStoreNames")}} {{readonlyInline}}
-
A {{ domxref("DOMStringList") }} that contains a list of the names of the object stores currently in the connected database.
-
- -

Event handlers

- -
-
{{domxref("IDBDatabase.onabort")}}
-
Fires when access of the database is aborted.
-
{{domxref("IDBDatabase.onclose")}}
-
Fires when the {{event("close")}} event occurs; this happens when the database is unexpectedly closed, such as during application shutdown.
-
{{domxref("IDBDatabase.onerror")}}
-
Fires when access to the database fails.
-
{{domxref("IDBDatabase.onversionchange")}}
-
-

Fires when a database structure change ({{domxref("IDBOpenDBRequest.onupgradeneeded")}} event or {{domxref("IDBFactory.deleteDatabase()")}} was requested elsewhere (most probably in another window/tab on the same computer). This is different from the version change transaction (see {{domxref("IDBVersionChangeEvent")}}), but it is related.

-
-
- -

Example

- -

In the following code snippet, we open a database asynchronously ({{domxref("IDBFactory")}}), handle success and error cases, and create a new object store in the case that an upgrade is needed ({{ domxref("IDBdatabase") }}). For a complete working example, see our To-do Notifications app (view example live.)

- -
// Let us open our database
+{{APIRef("IndexedDB")}}
+
+The **`IDBDatabase`** interface of the IndexedDB API provides a [connection to a database](/es/docs/IndexedDB#database_connection); you can use an `IDBDatabase` object to open a [transaction](/es/docs/IndexedDB#gloss_transaction) on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database.
+
+{{AvailableInWorkers}}
+
+> **Nota:** Everything you do in IndexedDB always happens in the context of a [transaction](/es/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_transaction), representing interactions with data in the database. All objects in IndexedDB — including object stores, indexes, and cursors — are tied to a particular transaction. Thus, you cannot execute commands, access data, or open anything outside of a transaction.
+
+## Methods
+
+Inherits from: [EventTarget](/es/docs/DOM/EventTarget)
+
+- {{domxref("IDBDatabase.close()")}}
+  - : Returns immediately and closes the connection to a database in a separate thread.
+- {{domxref("IDBDatabase.createObjectStore()")}}
+  - : Creates and returns a new object store or index.
+- {{domxref("IDBDatabase.deleteObjectStore()")}}
+  - : Destroys the object store with the given name in the connected database, along with any indexes that reference it.
+- {{domxref("IDBDatabase.transaction()")}}
+  - : Immediately returns a transaction object ({{domxref("IDBTransaction")}}) containing the {{domxref("IDBTransaction.objectStore")}} method, which you can use to access your object store. Runs in a separate thread.
+
+## Properties
+
+- {{domxref("IDBDatabase.name")}} {{readonlyInline}}
+  - : A {{ domxref("DOMString") }} that contains the name of the connected database.
+- {{domxref("IDBDatabase.version")}} {{readonlyInline}}
+  - : A [64-bit integer]() that contains the version of the connected database. When a database is first created, this attribute is an empty string.
+- {{domxref("IDBDatabase.objectStoreNames")}} {{readonlyInline}}
+  - : A {{ domxref("DOMStringList") }} that contains a list of the names of the [object stores](/es/docs/IndexedDB#gloss_object_store) currently in the connected database.
+
+### Event handlers
+
+- {{domxref("IDBDatabase.onabort")}}
+  - : Fires when access of the database is aborted.
+- {{domxref("IDBDatabase.onclose")}}
+  - : Fires when the {{event("close")}} event occurs; this happens when the database is unexpectedly closed, such as during application shutdown.
+- {{domxref("IDBDatabase.onerror")}}
+  - : Fires when access to the database fails.
+- {{domxref("IDBDatabase.onversionchange")}}
+  - : Fires when a database structure change ({{domxref("IDBOpenDBRequest.onupgradeneeded")}} event or` `{{domxref("IDBFactory.deleteDatabase()")}} was requested elsewhere (most probably in another window/tab on the same computer). This is different from the version change transaction (see {{domxref("IDBVersionChangeEvent")}}), but it is related.
+
+## Example
+
+In the following code snippet, we open a database asynchronously ({{domxref("IDBFactory")}}), handle success and error cases, and create a new object store in the case that an upgrade is needed ({{ domxref("IDBdatabase") }}). For a complete working example, see our [To-do Notifications](https://github.com/mdn/to-do-notifications/) app ([view example live](http://mdn.github.io/to-do-notifications/).)
+
+```
+// Let us open our database
   var DBOpenRequest = window.indexedDB.open("toDoList", 4);
 
   // these two event handlers act on the IDBDatabase object, when the database is opened successfully, or not
   DBOpenRequest.onerror = function(event) {
-    note.innerHTML += '<li>Error loading database.</li>';
+    note.innerHTML += '
  • Error loading database.
  • '; }; DBOpenRequest.onsuccess = function(event) { - note.innerHTML += '<li>Database initialised.</li>'; + note.innerHTML += '
  • Database initialised.
  • '; // store the result of opening the database in the db variable. This is used a lot later on db = DBOpenRequest.result; @@ -99,7 +88,7 @@ translation_of: Web/API/IDBDatabase var db = event.target.result; db.onerror = function(event) { - note.innerHTML += '<li>Error loading database.</li>'; + note.innerHTML += '
  • Error loading database.
  • '; }; // Create an objectStore for this database using IDBDatabase.createObjectStore @@ -116,49 +105,33 @@ translation_of: Web/API/IDBDatabase objectStore.createIndex("notified", "notified", { unique: false }); - note.innerHTML += '<li>Object store created.</li>'; - };
    - -

    This next line opens up a transaction on the Database, then opens an object store that we can then manipulate the data inside of.

    - -
        var objectStore = db.transaction('toDoList').objectStore('toDoList'); 
    - -

    Specifications

    - - - - - - - - - - - - - - - - - - - -
    SpecificationStatusComment
    {{SpecName('IndexedDB', '#idl-def-IDBDatabase', 'IDBDatabase')}}{{Spec2('IndexedDB')}}Initial version
    {{SpecName("IndexedDB 2", "#database-interface", "IDBDatabase")}}{{Spec2("IndexedDB 2")}}
    - -

    Browser compatibility

    + note.innerHTML += '
  • Object store created.
  • '; + }; +``` -{{Compat("api.IDBDatabase")}} +This next line opens up a transaction on the Database, then opens an object store that we can then manipulate the data inside of. -

    See also

    +```js + var objectStore = db.transaction('toDoList').objectStore('toDoList'); +``` + +## Specifications + +| Specification | Status | Comment | +| ---------------------------------------------------------------------------------------- | -------------------------------- | --------------- | +| {{SpecName('IndexedDB', '#idl-def-IDBDatabase', 'IDBDatabase')}} | {{Spec2('IndexedDB')}} | Initial version | +| {{SpecName("IndexedDB 2", "#database-interface", "IDBDatabase")}} | {{Spec2("IndexedDB 2")}} | | + +## Browser compatibility + +{{Compat("api.IDBDatabase")}} -
      -
    • Using IndexedDB
    • -
    • Starting transactions: {{domxref("IDBDatabase")}}
    • -
    • Using transactions: {{domxref("IDBTransaction")}}
    • -
    • Setting a range of keys: {{domxref("IDBKeyRange")}}
    • -
    • Retrieving and making changes to your data: {{domxref("IDBObjectStore")}}
    • -
    • Using cursors: {{domxref("IDBCursor")}}
    • -
    • Reference example: To-do Notifications (view example live.)
    • -
    +## See also -

    +- [Using IndexedDB](/es/docs/Web/API/IndexedDB_API/Using_IndexedDB) +- Starting transactions: {{domxref("IDBDatabase")}} +- Using transactions: {{domxref("IDBTransaction")}} +- Setting a range of keys: {{domxref("IDBKeyRange")}} +- Retrieving and making changes to your data: {{domxref("IDBObjectStore")}} +- Using cursors: {{domxref("IDBCursor")}} +- Reference example: [To-do Notifications](https://github.com/mdn/to-do-notifications/tree/gh-pages) ([view example live](http://mdn.github.io/to-do-notifications/).) diff --git a/files/es/web/api/idbdatabase/transaction/index.md b/files/es/web/api/idbdatabase/transaction/index.md index c5e74c52b36406..611171a08e6513 100644 --- a/files/es/web/api/idbdatabase/transaction/index.md +++ b/files/es/web/api/idbdatabase/transaction/index.md @@ -9,67 +9,45 @@ tags: - transacción translation_of: Web/API/IDBDatabase/transaction --- -

    {{ APIRef("IndexedDB") }}

    - -
    -

    El método transaction() [transacción] de la interfaz {{domxref("IDBDatabase")}} retorna inmediatamente un objeto de transacción ({{domxref("IDBTransaction")}}) que contiene el método {{domxref("IDBTransaction.objectStore")}}, el cual puedes usar para acceder a tu almacén de objetos.

    - -

    {{AvailableInWorkers}}

    -
    - -

    Sintáxis

    - -
    var transaccion = db.transaction(["toDoList"], "readwrite");
    - -

    Retorna

    - -

    Un objeto {{domxref("IDBTransaction")}}.

    - -

    Excepciones

    - -

    Éste método puede invocar una excepción {{domxref("DOMException")}} de alguno de los siguientes tipos:

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ExcepciónDescripción
    InvalidStateError -

    El método close() ha sido llamado previamente en esta instancia de {{domxref("IDBDatabase")}}.

    -
    NotFoundErrorUn almacén de objetos especificado en el parámetro storeNames ha sido borrado o removido.
    TypeErrorEl valor para el parámetro mode es inválido.
    InvalidAccessErrorLa función fue llamada con una lista vacía de nombres de almacenes.
    -
    - -

    Ejemplo

    - -

    En este ejemplo abrimos la conexión a una base de datos, luego usamos transaction() para abrir una transacción en dicha base de datos. Para un ejemplo completo, vea nuestra aplicación To-do Notifications (ver ejemplo en vivo).

    - -
    var db;
    +{{ APIRef("IndexedDB") }}
    +
    +El método **`transaction()`** _**`[transacción]`**_ de la interfaz {{domxref("IDBDatabase")}} retorna inmediatamente un objeto de transacción ({{domxref("IDBTransaction")}}) que contiene el método {{domxref("IDBTransaction.objectStore")}}, el cual puedes usar para acceder a tu almacén de objetos.
    +
    +{{AvailableInWorkers}}
    +
    +## Sintáxis
    +
    +```js
    +var transaccion = db.transaction(["toDoList"], "readwrite");
    +```
    +
    +### Retorna
    +
    +Un objeto {{domxref("IDBTransaction")}}.
    +
    +### Excepciones
    +
    +Éste método puede invocar una excepción {{domxref("DOMException")}} de alguno de los siguientes tipos:
    +
    +| Excepción                           | Descripción                                                                                                |
    +| ----------------------------------- | ---------------------------------------------------------------------------------------------------------- |
    +| [`InvalidStateError`](/en-US/docs/) | El método `close()` ha sido llamado previamente en esta instancia de {{domxref("IDBDatabase")}}. |
    +| `NotFoundError`                     | Un almacén de objetos especificado en el parámetro `storeNames` ha sido borrado o removido.                |
    +| `TypeError`                         | El valor para el parámetro `mode` es inválido.                                                             |
    +| `InvalidAccessError`                | La función fue llamada con una lista vacía de nombres de almacenes.                                        |
    +
    +## Ejemplo
    +
    +En este ejemplo abrimos la conexión a una base de datos, luego usamos `transaction()` para abrir una transacción en dicha base de datos. Para un ejemplo completo, vea nuestra aplicación [To-do Notifications](https://github.com/mdn/to-do-notifications/) ([ver ejemplo en vivo](http://mdn.github.io/to-do-notifications/)).
    +
    +```js
    +var db;
     
     // Abrimos nuestra base de datos:
     var DBOpenRequest = window.indexedDB.open("toDoList", 4);
     
     DBOpenRequest.onsuccess = function(event) {
    -  note.innerHTML += '<li>Base de datos inicializada.</li>';
    +  note.innerHTML += '
  • Base de datos inicializada.
  • '; // almacenar el resultado de la apertura de la base de datos en la variable db. Esto es bastante usado más abajo: db = DBOpenRequest.result; @@ -84,70 +62,68 @@ var transaction = db.transaction(["toDoList"], "readwrite"); // reportar cuando haya éxito al abrir la transacción transaction.oncomplete = function(event) { - note.innerHTML += '<li>Transacción completa: modificación a la base de datos finalizada.</li>'; + note.innerHTML += '
  • Transacción completa: modificación a la base de datos finalizada.
  • '; }; transaction.onerror = function(event) { - note.innerHTML += '<li>Transacción no abierta debido a un error. No se permite duplicar ítems.</li>'; + note.innerHTML += '
  • Transacción no abierta debido a un error. No se permite duplicar ítems.
  • '; }; // después deberías continuar y hacerle algo a esta base de datos a través del almacén de objetos: var objectStore = transaction.objectStore("toDoList"); -// etc.
    - -

    Parámetros

    - -
    -
    storeNames
    -
    Son los nombres de los almacenes de objetos e índices que están en el ámbito de la nueva transacción, declarados como un arreglo de cadenas de texto. Especifíca solamente aquellos a los que necesitas acceso.
    - Si necesitas acceder a un solo almacén, puedes especificar su nombre como una cadena. Por tanto las siguientes líneas son equivalentes:

    -
    var transaction = db.transaction(['my-store-name']);
    -var transaction = db.transaction('my-store-name');


    - Si necesitas acceder a todos los almacenes de objetos en la base de datos, puedes usar la propiedad {{domxref("IDBDatabase.objectStoreNames")}}: -
    var transaction = db.transaction(db.objectStoreNames);


    - Pasar un arreglo vació como parámetro arrojará una excepción.
    -
    mode
    -
    Opcional. Los tipos de acceso que pueden desempeñarse en la transacción. Las transacciones son abiertas en uno de tres modos: readonly [sólo lectura], readwrite [lectura/escritura], y readwriteflush [descarga de lectura/escritura] (no-estándar, sólo para Firefox). El modo versionchange [cambio de versión] no puede ser especificado aquí. Si no provees un parámetro, el modo predeterminado será readonly [sólo lectura]. Para evitar ralentizar las cosas, no abras una transacción readwrite [lectura/escritura] a menos que realmente necesites escribir en la base de datos.

    - Si necesitas abrir un almacén de objetos en modo readwrite para cambiar los datos, usa lo siguiente: -
    var transaction = db.transaction('my-store-name', "readwrite");
    - -

    Desde Firefox 40, las transacciones de IndexedDB tienen garantías de durabilidad relajadas para aumentar el rendimiento (ver {{Bug("1112702")}}), lo cual es el mismo comportamiento de otros navegadores que soportan IndexedDB. Es decir, anteriormente en una transacción readwrite el evento {{domxref("IDBTransaction.oncomplete")}} era invocado sólo cuando se garantizaba que todos los datos habían sido vaciados al disco duro. En Firefox 40+ el evento complete es accionado después de indicársele al Sistema Operativo que escriba los datos al disco pero esta confirmación podría suceder poco antes de que los datos hayan sido verdaderamente escritos en él. Si bien dicho evento puede entonces ser entregado un poco antes de tiempo, de cualquier modo, existe una pequeña probabilidad de que la entera transacción se pierda si el SO se bloquea o si ha ocurrido una pérdida de energía antes de que los datos efectivamente se descarguen al disco duro. Como esas catastróficas circunstancias son más bien raras, la mayoría de los consumidores no deberían preocuparse demasiado.

    - -
    -

    Nota: En Firefox, si deseas asegurar la durabilidad por alguna razón (por ejemplo, que estés almacenando datos críticos que no puedan ser recalculados después) puedes forzar una transacción a descargar al disco antes de invocar el evento complete creando una transacción que use un modo experimental readwriteflush (no-estándar) (ver {{domxref("IDBDatabase.transaction")}}). Esto actualmente es experimental, y puede usarse únicamente si la configuración dom.indexedDB.experimental es igual a true en about:config.

    -
    -
    -
    - -

    Especificación

    - - - - - - - - - - - - - - -
    EspecificaciónEstadoComentario
    {{SpecName('IndexedDB', '#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode', 'transaction()')}}{{Spec2('IndexedDB')}}
    - -

    Compatibilidad con Navegadores

    +// etc. +``` + +## Parámetros + +- storeNames + + - : Son los nombres de los almacenes de objetos e índices que están en el ámbito de la nueva transacción, declarados como un arreglo de cadenas de texto. Especifíca solamente aquellos a los que necesitas acceso. + Si necesitas acceder a un solo almacén, puedes especificar su nombre como una cadena. Por tanto las siguientes líneas son equivalentes: + + ``` + var transaction = db.transaction(['my-store-name']); + var transaction = db.transaction('my-store-name'); + ``` + + Si necesitas acceder a todos los almacenes de objetos en la base de datos, puedes usar la propiedad {{domxref("IDBDatabase.objectStoreNames")}}: + + ``` + var transaction = db.transaction(db.objectStoreNames); + ``` + + Pasar un arreglo vació como parámetro arrojará una excepción. + +- mode + + - : _Opcional_. Los tipos de acceso que pueden desempeñarse en la transacción. Las transacciones son abiertas en uno de tres modos: `readonly [sólo lectura], readwrite [lectura/escritura],` y `readwriteflush [descarga de lectura/escritura]` (no-estándar, sólo para Firefox). El modo `versionchange [cambio de versión] `no puede ser especificado aquí. Si no provees un parámetro, el modo predeterminado será `readonly [sólo lectura]`. Para evitar ralentizar las cosas, no abras una transacción `readwrite [lectura/escritura]` a menos que realmente necesites escribir en la base de datos. + + Si necesitas abrir un almacén de objetos en modo `readwrite` para cambiar los datos, usa lo siguiente: + + ```js + var transaction = db.transaction('my-store-name', "readwrite"); + ``` + + Desde Firefox 40, las transacciones de IndexedDB tienen garantías de durabilidad relajadas para aumentar el rendimiento (ver {{Bug("1112702")}}), lo cual es el mismo comportamiento de otros navegadores que soportan IndexedDB. Es decir, anteriormente en una transacción `readwrite` el evento {{domxref("IDBTransaction.oncomplete")}} era invocado sólo cuando se garantizaba que todos los datos habían sido vaciados al disco duro. En Firefox 40+ el evento `complete` es accionado después de indicársele al Sistema Operativo que escriba los datos al disco pero esta confirmación podría suceder poco antes de que los datos hayan sido verdaderamente escritos en él. Si bien dicho evento puede entonces ser entregado un poco antes de tiempo, de cualquier modo, existe una pequeña probabilidad de que la entera transacción se pierda si el SO se bloquea o si ha ocurrido una pérdida de energía antes de que los datos efectivamente se descarguen al disco duro. Como esas catastróficas circunstancias son más bien raras, la mayoría de los consumidores no deberían preocuparse demasiado. + + > **Nota:** En Firefox, si deseas asegurar la durabilidad por alguna razón (por ejemplo, que estés almacenando datos críticos que no puedan ser recalculados después) puedes forzar una transacción a descargar al disco antes de invocar el evento `complete` creando una transacción que use un modo experimental `readwriteflush` (no-estándar) (ver {{domxref("IDBDatabase.transaction")}}). Esto actualmente es experimental, y puede usarse únicamente si la configuración `dom.indexedDB.experimental` es igual a `true` en `about:config`. + +## Especificación + +| Especificación | Estado | Comentario | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ---------- | +| {{SpecName('IndexedDB', '#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode', 'transaction()')}} | {{Spec2('IndexedDB')}} | | + +## Compatibilidad con Navegadores {{Compat("api.IDBDatabase.transaction")}} -

    Ver también

    - -
      -
    • Usando IndexedDB
    • -
    • Iniciando transacciones: {{domxref("IDBDatabase")}}
    • -
    • Usando transacciones: {{domxref("IDBTransaction")}}
    • -
    • Configurar un rango de llaves: {{domxref("IDBKeyRange")}}
    • -
    • Recuperando y haciendo cambios a tus datos: {{domxref("IDBObjectStore")}}
    • -
    • Usando cursores: {{domxref("IDBCursor")}}
    • -
    • Ejemplo de referencia: To-do Notifications (ver ejemplo en vivo).
    • -
    +## Ver también + +- [Usando IndexedDB](/es/docs/Web/API/IndexedDB_API/Using_IndexedDB) +- Iniciando transacciones: {{domxref("IDBDatabase")}} +- Usando transacciones: {{domxref("IDBTransaction")}} +- Configurar un rango de llaves: {{domxref("IDBKeyRange")}} +- Recuperando y haciendo cambios a tus datos: {{domxref("IDBObjectStore")}} +- Usando cursores: {{domxref("IDBCursor")}} +- Ejemplo de referencia: [To-do Notifications](https://github.com/mdn/to-do-notifications/tree/gh-pages) ([ver ejemplo en vivo](http://mdn.github.io/to-do-notifications/)). diff --git a/files/es/web/api/idbobjectstore/add/index.md b/files/es/web/api/idbobjectstore/add/index.md index 9384d0d650933b..2567942085dcbe 100644 --- a/files/es/web/api/idbobjectstore/add/index.md +++ b/files/es/web/api/idbobjectstore/add/index.md @@ -11,38 +11,56 @@ tags: - Referencia translation_of: Web/API/IDBObjectStore/add --- -

    {{ APIRef("IDBObjectStore") }}

    -
    -

    El metodo add() de la interfaz {{domxref("IDBObjectStore")}} retorna un objeto {{domxref("IDBRequest")}}, y, un hilo separado, crea un clone estructurado del valor, y almacena el valor clonado en el almacén de objetos. Esto es para agregar nevos registros a un almacén de objetos.

    -

    Para determinar si la operación de agregar fue completada satisfactoriamente, escucha el evento complete de la transaccion en adicion al evento success de la peticion IDBojectStore.add, porque la transaccion y todavía puede fallar después de lanzar el evento success. En otras palabras, el eventos success sólo es lanzado cuando la transacción ha sido puesta en cola satisfactoriamente.

    -

    El método agregar es un método de sólo inserción. Si un registro ya existe en el almacén de objetos con el argumento key como su clave, entonces un error ConstrainError es lanzado en el objeto petición devuelto. Para actualizar registros existentes, debes usar el método {{domxref("IDBObjectStore.put")}} en su lugar.

    -
    -

    Sintaxis

    -
    var request = objectStore.add(myItem, optionalKey);
    -

    Retorno

    -

    Un objeto {{domxref("IDBRequest")}} en el que los eventos subsecuentes relacionados a esta operación son lanzados.

    -

    Excepciones

    -

    Este método puede generar un {{domxref("DOMException")}} con un {{domxref("DOMError")}} de uno de los siguiente tipos:

    - -
    -
    ReadOnlyError
    La transacción asociada con esta operación está en un modo de sólo lectura.
    TransactionInactiveError
    Esta transacción de IDBObjectStore's está inactiva.
    DataError
    -

    Cualquiera de los siguientes condiciones aplica:

    -
      -
    • El almacén de objetos usa llaves en línea o tiene un generador de llaves, y una argumento llave fue proporcionado.
    • -
    • El almacén de objetos usa llaves fuera de línea y no tiene un generador de llaves, y un argumento llave fue proporcionado.
    • -
    • El almacén de objetos usa llaves en línea pero no un generador de llaves, y la ruta de la llave del almacén de objetos no da una llave válida.
    • -
    • El argumento llave fue proporcionado pero no contiene una llave válida.
    • -
    -
    InvalidStateError
    El IDBObjectStore ha sido borrado o removido.
    DataCloneError
    Los datos siendo almacenados no pueden ser clonados por el algoritmo de clonado estructurado interno.
    -
    - -

    Ejemplo

    -

    En el siguiente código, abrimos una transacción read/write en nuestra base de datos y agregado algunos datos al almacén de datos usando add(). También ten en cuenta que las funciones adjuntas a los manejadores de eventos de la transacción para informar en la salida de la apertura de transacciones en el evento de éxito o falla. Para un ejemplo completo funcionando, mira nuestra aplicación To-do Notifications (ver ejemplo).

    -
    // Abrimos nuestra base de datos
    -var DBOpenRequest = window.indexedDB.open("toDoList", 4);
    -
    -DBOpenRequest.onsuccess = function(event) {
    -  note.innerHTML += '<li>Database initialised.</li>';
    +{{ APIRef("IDBObjectStore") }}
    +
    +El metodo `add()` de la interfaz {{domxref("IDBObjectStore")}} retorna un objeto {{domxref("IDBRequest")}}, y, un hilo separado, crea un [clone estructurado](http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#structured-clone) del valor, y almacena el valor clonado en el almacén de objetos. Esto es para agregar nevos registros a un almacén de objetos.
    +
    +Para determinar si la operación de agregar fue completada satisfactoriamente, escucha el evento `complete` de la transaccion en adicion al evento `success` de la peticion `IDBojectStore.add`, porque la transaccion y todavía puede fallar después de lanzar el evento success. En otras palabras, el eventos success sólo es lanzado cuando la transacción ha sido puesta en cola satisfactoriamente.
    +
    +El método agregar es un método de _sólo inserción_. Si un registro ya existe en el almacén de objetos con el argumento `key` como su clave, entonces un error `ConstrainError` es lanzado en el objeto petición devuelto. Para actualizar registros existentes, debes usar el método {{domxref("IDBObjectStore.put")}} en su lugar.
    +
    +## Sintaxis
    +
    +```js
    +var request = objectStore.add(myItem, optionalKey);
    +```
    +
    +### Retorno
    +
    +Un objeto {{domxref("IDBRequest")}} en el que los eventos subsecuentes relacionados a esta operación son lanzados.
    +
    +### Excepciones
    +
    +Este método puede generar un {{domxref("DOMException")}} con un {{domxref("DOMError")}} de uno de los siguiente tipos:
    +
    +- `ReadOnlyError`
    +  - : La transacción asociada con esta operación está en un [modo](/es/docs/Web/API/IDBTransaction#mode_constants "/en-US/docs/IndexedDB/IDBTransaction#mode_constants") de sólo lectura.
    +- `TransactionInactiveError`
    +  - : Esta transacción de [`IDBObjectStore`](/es/docs/Web/API/IDBObjectStore)'s está inactiva.
    +- `DataError`
    +
    +  - : Cualquiera de los siguientes condiciones aplica:
    +
    +    - El almacén de objetos usa llaves en línea o tiene un generador de llaves, y una argumento llave fue proporcionado.
    +    - El almacén de objetos usa llaves fuera de línea y no tiene un generador de llaves, y un argumento llave fue proporcionado.
    +    - El almacén de objetos usa llaves en línea pero no un generador de llaves, y la ruta de la llave del almacén de objetos no da una llave válida.
    +    - El argumento llave fue proporcionado pero no contiene una llave válida.
    +
    +- `InvalidStateError`
    +  - : El [`IDBObjectStore`](/es/docs/Web/API/IDBObjectStore) ha sido borrado o removido.
    +- `DataCloneError`
    +  - : Los datos siendo almacenados no pueden ser clonados por el algoritmo de clonado estructurado interno.
    +
    +## Ejemplo
    +
    +En el siguiente código, abrimos una transacción read/write en nuestra base de datos y agregado algunos datos al almacén de datos usando `add()`. También ten en cuenta que las funciones adjuntas a los manejadores de eventos de la transacción para informar en la salida de la apertura de transacciones en el evento de éxito o falla. Para un ejemplo completo funcionando, mira nuestra aplicación [To-do Notifications](https://github.com/mdn/to-do-notifications/) ([ver ejemplo](http://mdn.github.io/to-do-notifications/)).
    +
    +```js
    +// Abrimos nuestra base de datos
    +var DBOpenRequest = window.indexedDB.open("toDoList", 4);
    +
    +DBOpenRequest.onsuccess = function(event) {
    +  note.innerHTML += '
  • Database initialised.
  • '; // Almacenar el resultado de la apertura de la base de datos en la variable db. Esta es usada mucho después db = DBOpenRequest.result; @@ -60,12 +78,12 @@ function addData() { // Informa sobre el éxito de la inicio de la transacción transaction.oncomplete = function(event) { - note.innerHTML += '<li>Transaction completed: database modification finished.</li>'; + note.innerHTML += '
  • Transaction completed: database modification finished.
  • '; }; transaction.onerror = function(event) { - note.innerHTML += '<li>Transaction not opened due to error. Duplicate items not allowed.</li>'; + note.innerHTML += '
  • Transaction not opened due to error. Duplicate items not allowed.
  • '; }; // Crea una almacén de objetos en la transacción @@ -76,46 +94,34 @@ function addData() { objectStoreRequest.onsuccess = function(event) { //Informa sobre el éxito de nuestro nuevo elemento en la base de datos - note.innerHTML += '<li>New item added to database.</li>'; + note.innerHTML += '
  • New item added to database.
  • '; }; -};
    -

    Parámetros

    -
    -
    - value
    -
    - El valor para ser almacenado.
    -
    - key
    -
    - La llave a usar para identificar el registro. Si no es especificada, el resultado es nulo.
    -
    -

    Especificación

    - - - - - - - - - - - - - -
    EspecificaciónEstadoComentario
    {{SpecName('IndexedDB', '#widl-IDBObjectStore-add-IDBRequest-any-value-any-key', 'add()')}}{{Spec2('IndexedDB')}}
    -

    Compatibilidad de navegadores

    -
    +}; +``` + +## Parámetros + +- value + - : El valor para ser almacenado. +- key + - : La llave a usar para identificar el registro. Si no es especificada, el resultado es nulo. + +## Especificación + +| Especificación | Estado | Comentario | +| ------------------------------------------------------------------------------------------------------------------------ | ---------------------------- | ---------- | +| {{SpecName('IndexedDB', '#widl-IDBObjectStore-add-IDBRequest-any-value-any-key', 'add()')}} | {{Spec2('IndexedDB')}} | | + +## Compatibilidad de navegadores + {{Compat("api.IDBObjectStore.add")}} -

    Ver también

    -
      -
    • Usando IndexedDB
    • -
    • Iniciando transacciones: {{domxref("IDBDatabase")}}
    • -
    • Usando transacciones: {{domxref("IDBTransaction")}}
    • -
    • Estableciendo un rango de llaves: {{domxref("IDBKeyRange")}}
    • -
    • Obteniendo y haciendo cambios a tus datos: {{domxref("IDBObjectStore")}}
    • -
    • Usando cursores: {{domxref("IDBCursor")}}
    • -
    • Ejemplo de referencia: To-do Notifications (ver ejemplo.)
    • -
    +## Ver también + +- [Usando IndexedDB](/es/docs/Web/API/IndexedDB_API/Using_IndexedDB) +- Iniciando transacciones: {{domxref("IDBDatabase")}} +- Usando transacciones: {{domxref("IDBTransaction")}} +- Estableciendo un rango de llaves: {{domxref("IDBKeyRange")}} +- Obteniendo y haciendo cambios a tus datos: {{domxref("IDBObjectStore")}} +- Usando cursores: {{domxref("IDBCursor")}} +- Ejemplo de referencia: [To-do Notifications](https://github.com/mdn/to-do-notifications/tree/gh-pages) ([ver ejemplo](http://mdn.github.io/to-do-notifications/).) diff --git a/files/es/web/api/idbobjectstore/index.md b/files/es/web/api/idbobjectstore/index.md index 619351c8a2a329..9eecb99ae16620 100644 --- a/files/es/web/api/idbobjectstore/index.md +++ b/files/es/web/api/idbobjectstore/index.md @@ -5,66 +5,59 @@ tags: - API translation_of: Web/API/IDBObjectStore --- -

    {{APIRef("IndexedDB")}}

    - -
    -

    The IDBObjectStore interface of the IndexedDB API represents an object store in a database. Records within an object store are sorted according to their keys. This sorting enables fast insertion, look-up, and ordered retrieval.

    -
    - -

    Methods

    - -
    -
    {{domxref("IDBObjectStore.add")}}
    -
    Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store. This is for adding new records to an object store.
    -
    {{domxref("IDBObjectStore.clear")}}
    -
    Creates and immediately returns an {{domxref("IDBRequest")}} object, and clears this object store in a separate thread. This is for deleting all current records out of an object store.
    -
    {{domxref("IDBObjectStore.delete")}}
    -
    returns an {{domxref("IDBRequest")}} object, and, in a separate thread, deletes the current object store. This is for deleting individual records out of an object store.
    -
    {{domxref("IDBObjectStore.get")}}
    -
    returns an {{domxref("IDBRequest")}} object, and, in a separate thread, returns the object store selected by the specified key. This is for retrieving specific records from an object store.
    -
    {{domxref("IDBObjectStore.createIndex")}}
    -
    Creates a new index during a version upgrade, returning a new {{domxref("IDBIndex")}} object in the connected database.
    -
    {{domxref("IDBObjectStore.deleteIndex")}}
    -
    Destroys the specified index in the connected database, used during a version upgrade.
    -
    {{domxref("IDBObjectStore.index")}}
    -
    Opens an index from this object store after which it can, for example, be used to return a sequence of records sorted by that index using a cursor.
    -
    {{domxref("IDBObjectStore.put")}}
    -
    Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store. This is for updating existing records in an object store when the transaction's mode is readwrite.
    -
    {{domxref("IDBObjectStore.openCursor")}}
    -
    Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, returns a new {{domxref("IDBCursorWithValue")}} object. Used for iterating through an object store by primary key with a cursor.
    -
    - -

    Properties

    - -
    -
    {{domxref("IDBObjectStore.indexNames")}} {{readonlyInline}}
    -
    A list of the names of indexes on objects in this object store.
    -
    {{domxref("IDBObjectStore.keyPath")}} {{readonlyInline}}
    -
    The key path of this object store. If this attribute is null, the application must provide a key for each modification operation.
    -
    {{domxref("IDBObjectStore.name")}} {{readonlyInline}}
    -
    The name of this object store.
    -
    {{domxref("IDBObjectStore.transaction")}} {{readonlyInline}}
    -
    The name of the transaction to which this object store belongs.
    -
    {{domxref("IDBObjectStore.autoIncrement")}} {{readonlyInline}}
    -
    The value of the auto increment flag for this object store.
    -
    - -

    Obsolete methods

    - -
    -
    {{domxref("IDBObjectStore.openKeyCursor")}}
    -
    Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, returns a new {{domxref("IDBCursorWithValue")}}. Used for iterating through an object store with a key. However, this is now handled by {{domxref("IDBObjectStore.openCursor")}}, if a value is specified.
    -
    - -

    Example

    - -

    This example shows a variety of different uses of ObjectStores, from updating the data structure with {{domxref("IDBObjectStore.createIndex")}} inside an onupgradeneeded function, to adding a new item to our object store with {{domxref("IDBObjectStore.add")}}. For a full working example, see our To-do Notifications app (view example live.)

    - -
    // Let us open our database
    +{{APIRef("IndexedDB")}}
    +
    +The `IDBObjectStore` interface of the [IndexedDB API](/en/IndexedDB "en/IndexedDB") represents an [object store](/en/IndexedDB#gloss_object_store "en/IndexedDB#gloss object store") in a database. Records within an object store are sorted according to their keys. This sorting enables fast insertion, look-up, and ordered retrieval.
    +
    +## Methods
    +
    +- {{domxref("IDBObjectStore.add")}}
    +  - : Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, creates a [structured clone](http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#structured-clone) of the `value`, and stores the cloned value in the object store. This is for adding new records to an object store.
    +- {{domxref("IDBObjectStore.clear")}}
    +  - : Creates and immediately returns an {{domxref("IDBRequest")}} object, and clears this object store in a separate thread. This is for deleting all current records out of an object store.
    +- {{domxref("IDBObjectStore.delete")}}
    +  - : returns an {{domxref("IDBRequest")}} object, and, in a separate thread, deletes the current object store. This is for deleting individual records out of an object store.
    +- {{domxref("IDBObjectStore.get")}}
    +  - : returns an {{domxref("IDBRequest")}} object, and, in a separate thread, returns the object store selected by the specified key. This is for retrieving specific records from an object store.
    +- {{domxref("IDBObjectStore.createIndex")}}
    +  - : Creates a new index during a version upgrade, returning a new {{domxref("IDBIndex")}} object in the connected database.
    +- {{domxref("IDBObjectStore.deleteIndex")}}
    +  - : Destroys the specified index in the connected database, used during a version upgrade.
    +- {{domxref("IDBObjectStore.index")}}
    +  - : Opens an index from this object store after which it can, for example, be used to return a sequence of records sorted by that index using a cursor.
    +- {{domxref("IDBObjectStore.put")}}
    +  - : Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, creates a [structured clone](http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#structured-clone) of the `value`, and stores the cloned value in the object store. This is for updating existing records in an object store when the transaction's mode is `readwrite`.
    +- {{domxref("IDBObjectStore.openCursor")}}
    +  - : Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, returns a new {{domxref("IDBCursorWithValue")}} object. Used for iterating through an object store by primary key with a cursor.
    +
    +## Properties
    +
    +- {{domxref("IDBObjectStore.indexNames")}} {{readonlyInline}}
    +  - : A list of the names of [indexes](/en/IndexedDB#gloss_index "en/IndexedDB#gloss index") on objects in this object store.
    +- {{domxref("IDBObjectStore.keyPath")}} {{readonlyInline}}
    +  - : The [key path](/en/IndexedDB#gloss_key_path "en/IndexedDB#gloss key path") of this object store. If this attribute is null, the application must provide a key for each modification operation.
    +- {{domxref("IDBObjectStore.name")}} {{readonlyInline}}
    +  - : The name of this object store.
    +- {{domxref("IDBObjectStore.transaction")}} {{readonlyInline}}
    +  - : The name of the transaction to which this object store belongs.
    +- {{domxref("IDBObjectStore.autoIncrement")}} {{readonlyInline}}
    +  - : The value of the auto increment flag for this object store.
    +
    +## Obsolete methods
    +
    +- {{domxref("IDBObjectStore.openKeyCursor")}}
    +  - : Returns an {{domxref("IDBRequest")}} object, and, in a separate thread, returns a new {{domxref("IDBCursorWithValue")}}. Used for iterating through an object store with a key. However, this is now handled by {{domxref("IDBObjectStore.openCursor")}}, if a value is specified.
    +
    +## Example
    +
    +This example shows a variety of different uses of ObjectStores, from updating the data structure with {{domxref("IDBObjectStore.createIndex")}} inside an `onupgradeneeded` function, to adding a new item to our object store with {{domxref("IDBObjectStore.add")}}. For a full working example, see our [To-do Notifications](https://github.com/mdn/to-do-notifications/) app ([view example live](http://mdn.github.io/to-do-notifications/).)
    +
    +```js
    +// Let us open our database
     var DBOpenRequest = window.indexedDB.open("toDoList", 4);
     
     DBOpenRequest.onsuccess = function(event) {
    -  note.innerHTML += '<li>Database initialised.</li>';
    +  note.innerHTML += '
  • Database initialised.
  • '; // store the result of opening the database in the db variable. db = DBOpenRequest.result; @@ -77,7 +70,7 @@ DBOpenRequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { - note.innerHTML += '<li>Error loading database.</li>'; + note.innerHTML += '
  • Error loading database.
  • '; }; // Create an objectStore for this database @@ -94,7 +87,7 @@ DBOpenRequest.onupgradeneeded = function(event) { objectStore.createIndex("notified", "notified", { unique: false }); - note.innerHTML += '<li>Object store created.</li>'; + note.innerHTML += '
  • Object store created.
  • '; }; // Create a new item to add in to the object store @@ -107,11 +100,11 @@ var transaction = db.transaction(["toDoList"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { - note.innerHTML += '<li>Transaction opened for task addition.</li>'; + note.innerHTML += '
  • Transaction opened for task addition.
  • '; }; transaction.onerror = function(event) { - note.innerHTML += '<li>Transaction not opened due to error. Duplicate items not allowed.</li>'; + note.innerHTML += '
  • Transaction not opened due to error. Duplicate items not allowed.
  • '; }; // create an object store on the transaction @@ -120,38 +113,26 @@ var objectStore = transaction.objectStore("toDoList"); var objectStoreRequest = objectStore.add(newItem[0]); objectStoreRequest.onsuccess = function(event) { - note.innerHTML += '<li>New item added to database.</li>'; -}
    - -

    Specifications

    - - - - - - - - - - - - - - -
    SpecificationStatusComment
    {{SpecName('IndexedDB', '#idl-def-IDBObjectStore', 'IDBObjectStore')}}{{Spec2('IndexedDB')}}
    - -

    Browser compatibility

    + note.innerHTML += '
  • New item added to database.
  • '; +} +``` + +## Specifications + +| Specification | Status | Comment | +| -------------------------------------------------------------------------------------------- | ---------------------------- | ------- | +| {{SpecName('IndexedDB', '#idl-def-IDBObjectStore', 'IDBObjectStore')}} | {{Spec2('IndexedDB')}} | | + +## Browser compatibility {{Compat("api.IDBObjectStore")}} -

    See also

    - -
      -
    • Using IndexedDB
    • -
    • Starting transactions: {{domxref("IDBDatabase")}}
    • -
    • Using transactions: {{domxref("IDBTransaction")}}
    • -
    • Setting a range of keys: {{domxref("IDBKeyRange")}}
    • -
    • Retrieving and making changes to your data: {{domxref("IDBObjectStore")}}
    • -
    • Using cursors: {{domxref("IDBCursor")}}
    • -
    • Reference example: To-do Notifications (view example live.)
    • -
    +## See also + +- [Using IndexedDB](/es/docs/Web/API/IndexedDB_API/Using_IndexedDB) +- Starting transactions: {{domxref("IDBDatabase")}} +- Using transactions: {{domxref("IDBTransaction")}} +- Setting a range of keys: {{domxref("IDBKeyRange")}} +- Retrieving and making changes to your data: {{domxref("IDBObjectStore")}} +- Using cursors: {{domxref("IDBCursor")}} +- Reference example: [To-do Notifications](https://github.com/mdn/to-do-notifications/tree/gh-pages) ([view example live](http://mdn.github.io/to-do-notifications/).) diff --git a/files/es/web/api/imagebitmap/index.md b/files/es/web/api/imagebitmap/index.md index 96eb24aa2e97cb..345c8e9628e924 100644 --- a/files/es/web/api/imagebitmap/index.md +++ b/files/es/web/api/imagebitmap/index.md @@ -8,58 +8,35 @@ tags: - Referencia translation_of: Web/API/ImageBitmap --- -
    {{APIRef("Canvas API")}}
    +{{APIRef("Canvas API")}} -

    The ImageBitmap interface represents a bitmap image which can be drawn to a {{HTMLElement("canvas")}} without undue latency. It can be created from a variety of source objects using the {{domxref("ImageBitmapFactories.createImageBitmap", "createImageBitmap()")}} factory method. ImageBitmap provides an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL.

    +The **`ImageBitmap`** interface represents a bitmap image which can be drawn to a {{HTMLElement("canvas")}} without undue latency. It can be created from a variety of source objects using the {{domxref("ImageBitmapFactories.createImageBitmap", "createImageBitmap()")}} factory method. `ImageBitmap` provides an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL. -

    Properties

    +## Properties -
    -
    {{domxref("ImageBitmap.height")}} {{readonlyInline}}
    -
    Is an unsigned long representing the height, in CSS pixels, of the ImageData.
    -
    {{domxref("ImageBitmap.width")}} {{readonlyInline}}
    -
    Is an unsigned long representing the width, in CSS pixels, of the ImageData.
    -
    +- {{domxref("ImageBitmap.height")}} {{readonlyInline}} + - : Is an `unsigned` `long` representing the height, in CSS pixels, of the `ImageData`. +- {{domxref("ImageBitmap.width")}} {{readonlyInline}} + - : Is an `unsigned` `long` representing the width, in CSS pixels, of the `ImageData`. -

    Methods

    +## Methods -
    -
    {{domxref("ImageBitmap.close()")}}
    -
    -

    Disposes of all graphical resources associated with an ImageBitmap.

    -
    -
    +- {{domxref("ImageBitmap.close()")}} + - : Disposes of all graphical resources associated with an `ImageBitmap`. -

    Specifications

    +## Specifications - - - - - - - - - - - - - - - -
    SpecificationStatusComment
    {{SpecName('HTML WHATWG', "webappapis.html#imagebitmap", "ImageBitmap")}}{{Spec2('HTML WHATWG')}}
    +| Specification | Status | Comment | +| ------------------------------------------------------------------------------------------------ | -------------------------------- | ------- | +| {{SpecName('HTML WHATWG', "webappapis.html#imagebitmap", "ImageBitmap")}} | {{Spec2('HTML WHATWG')}} | | -

    Browser compatibility

    +## Browser compatibility +{{Compat("api.ImageBitmap")}} +## See also -

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

    - -

    See also

    - -
      -
    • {{domxref("ImageBitmapFactories.createImageBitmap()")}}
    • -
    • {{domxref("CanvasRenderingContext2D.drawImage()")}}
    • -
    • {{domxref("WebGLRenderingContext.texImage2D()")}}
    • -
    • {{domxref("OffScreenCanvas.transferToImageBitmap()")}}
    • -
    +- {{domxref("ImageBitmapFactories.createImageBitmap()")}} +- {{domxref("CanvasRenderingContext2D.drawImage()")}} +- {{domxref("WebGLRenderingContext.texImage2D()")}} +- {{domxref("OffScreenCanvas.transferToImageBitmap()")}} diff --git a/files/es/web/api/imagebitmaprenderingcontext/index.md b/files/es/web/api/imagebitmaprenderingcontext/index.md index 5f1fd5e2dcb82f..75d3e7f851a827 100644 --- a/files/es/web/api/imagebitmaprenderingcontext/index.md +++ b/files/es/web/api/imagebitmaprenderingcontext/index.md @@ -3,35 +3,25 @@ title: ImageBitmapRenderingContext slug: Web/API/ImageBitmapRenderingContext translation_of: Web/API/ImageBitmapRenderingContext --- -
    {{APIRef("Canvas API")}} {{SeeCompatTable}}
    +{{APIRef("Canvas API")}} {{SeeCompatTable}} -

    El interface ImageBitmapRenderingContext es un lienzo de contexto renderizado que sólo permite la funcionalidad de reemplazar el contenido del lienzo ( <canvas> ) con el {{domxref("ImageBitmap")}} dado. La identificación de contenido (el primer argumento a {{domxref("HTMLCanvasElement.getContext()")}} o {{domxref("OffscreenCanvas.getContext()")}} es "bitmaprenderer".

    +El interface **`ImageBitmapRenderingContext`** es un lienzo de contexto renderizado que sólo permite la funcionalidad de reemplazar el contenido del lienzo ( [``](/es/docs/Web/HTML/Element/canvas "Use the HTML element with either the canvas scripting API or the WebGL API to draw graphics and animations.") ) con el {{domxref("ImageBitmap")}} dado. La identificación de contenido (el primer argumento a {{domxref("HTMLCanvasElement.getContext()")}} o {{domxref("OffscreenCanvas.getContext()")}} es `"bitmaprenderer"`. -

    Esta interface es posible en ambos , la ventana y el "worker context" (contexto de tabajo).

    +Esta interface es posible en ambos , la ventana y el ["worker context" ](/es/docs/Web/API/Web_Workers_API)(contexto de tabajo). -

    Métodos

    +## Métodos -
    -
    {{domxref("ImageBitmapRenderingContext.transferFromImageBitmap()")}}
    -
    -

    Muestra el ImageBitmap en el lienzo asociado con el contexto de renderizado. La propiedad del ImageBitmap se transfiere al lienzo. Este se llamaba transferImageBitmap(), pero se renombra en un cambio especulativo . El viejo nombre se mantiene como un alias para evitar una ruptura del código.

    -
    -
    +- {{domxref("ImageBitmapRenderingContext.transferFromImageBitmap()")}} + - : Muestra el `ImageBitmap` en el lienzo asociado con el contexto de renderizado. La propiedad del `ImageBitmap` se transfiere al lienzo. Este se llamaba `transferImageBitmap()`, pero se renombra en un cambio especulativo . El viejo nombre se mantiene como un alias para evitar una ruptura del código. -

    Especificaciones

    +## Especificaciones -

    Escrito como una propuesta en la especificaación OffscreenCanvas.

    +Escrito como una propuesta en la especificaación [OffscreenCanvas](https://wiki.whatwg.org/wiki/OffscreenCanvas). -

    Compatibilidad del Buscador

    +## Compatibilidad del Buscador -
    +{{Compat("api.ImageBitmapRenderingContext")}} +## Ver también -

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

    -
    - -

    Ver también

    - -
      -
    • {{domxref("OffScreenCanvas")}}
    • -
    +- {{domxref("OffScreenCanvas")}} diff --git a/files/es/web/api/index.md b/files/es/web/api/index.md index cc3173dacca0c4..4abc6fbdadb1db 100644 --- a/files/es/web/api/index.md +++ b/files/es/web/api/index.md @@ -9,29 +9,22 @@ tags: - Web translation_of: Web/API --- -

    Cuando escribimos código para la web utilizando JavaScript, podemos usar gran número de APIs disponibles. A continuación mostramos una lista de todas las interfaces (es decir, tipos de objetos) que puedes usar al desarrollar tu aplicación o sitio Web. Para obtener una lista de las API que contiene cada una de estas interfaces, consulta la referencia de la API Web.

    +Cuando escribimos código para la web utilizando JavaScript, podemos usar gran número de APIs disponibles. A continuación mostramos una lista de todas las interfaces (es decir, tipos de objetos) que puedes usar al desarrollar tu aplicación o sitio Web. Para obtener una lista de las API que contiene cada una de estas interfaces, consulta la referencia de la API Web. -
    {{APIListAlpha}}
    +{{APIListAlpha}} +## Especificaciones +Esta es una lista de todas las APIs que están disponibles. -

    Especificaciones

    +{{ListGroups}} -

    Esta es una lista de todas las APIs que están disponibles.

    +## Interfaces -

    {{ListGroups}}

    +Esta es una lista de todas las interfaces (es decir, tipos de objetos) que están disponibles -

    Interfaces

    +{{APIListAlpha}} -


    - Esta es una lista de todas las interfaces (es decir, tipos de objetos) que están disponibles

    +## Ve también -

    {{APIListAlpha}}

    - -

    Ve también

    - - - - +- [Referencia de la API de eventos web](/es/docs/Web/Events) diff --git a/files/es/web/api/indexeddb/index.md b/files/es/web/api/indexeddb/index.md index fd93653a4eb5bb..5e656df665330d 100644 --- a/files/es/web/api/indexeddb/index.md +++ b/files/es/web/api/indexeddb/index.md @@ -4,62 +4,49 @@ slug: Web/API/indexedDB translation_of: Web/API/WindowOrWorkerGlobalScope/indexedDB original_slug: Web/API/WindowOrWorkerGlobalScope/indexedDB --- -

    {{ APIRef() }}

    +{{ APIRef() }} -

    La propiedad indexedDB del mixin {{domxref("WindowOrWorkerGlobalScope")}} proporciona un mecanismo para que las aplicaciones puedan acceder asíncronamente a las capacidades de las bases de datos indexadas.

    +La propiedad **`indexedDB`** del mixin {{domxref("WindowOrWorkerGlobalScope")}} proporciona un mecanismo para que las aplicaciones puedan acceder asíncronamente a las capacidades de las bases de datos indexadas. -

    Sintaxis

    +## Sintaxis -
    var DBOpenRequest = self.indexedDB.open('toDoList');
    +```js +var DBOpenRequest = self.indexedDB.open('toDoList'); +``` -

    Valor

    +### Valor -

    Un objeto {{domxref("IDBFactory")}}.

    +Un objeto {{domxref("IDBFactory")}}. -

    Ejemplo

    +## Ejemplo -
    var db;
    +```
    +var db;
     function openDB() {
      var DBOpenRequest = window.indexedDB.open('toDoList');
      DBOpenRequest.onsuccess = function(e) {
        db = DBOpenRequest.result;
      }
    -}
    +} +``` -

    Especificaciones

    +## Especificaciones - - - - - - - - - - - - - - - - - - -
    EspecificaciónEstadoComentario
    {{SpecName('IndexedDB 2', '#dom-windoworworkerglobalscope-indexeddb', 'indexedDB')}}{{Spec2('IndexedDB 2')}}Definido en un WindowOrWorkerGlobalScope parcial en la última especificación.
    {{SpecName('IndexedDB', '#widl-IDBEnvironment-indexedDB', 'indexedDB')}}{{Spec2('IndexedDB')}}Definición inicial.
    +| Especificación | Estado | Comentario | +| ---------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------- | +| {{SpecName('IndexedDB 2', '#dom-windoworworkerglobalscope-indexeddb', 'indexedDB')}} | {{Spec2('IndexedDB 2')}} | Definido en un `WindowOrWorkerGlobalScope` parcial en la última especificación. | +| {{SpecName('IndexedDB', '#widl-IDBEnvironment-indexedDB', 'indexedDB')}} | {{Spec2('IndexedDB')}} | Definición inicial. | -

    Compatibilidad de Navegadores

    +## Compatibilidad de Navegadores {{Compat("api.indexedDB")}} -

    Ver también

    +## Ver también -
      -
    • Utilización de IndexedDB
    • -
    • Iniciando transacciones: {{domxref("IDBDatabase")}}
    • -
    • Usando transacciones: {{domxref("IDBTransaction")}}
    • -
    • Estableciendo un rango de claves: {{domxref("IDBKeyRange")}}
    • -
    • Recuperación y edición de tus datos: {{domxref("IDBObjectStore")}}
    • -
    • Utilización de cursores: {{domxref("IDBCursor")}}
    • -
    • Ejemplo de referencia: To-do Notifications (ver ejemplo live.)
    • -
    +- [Utilización de IndexedDB](/es/docs/Web/API/IndexedDB_API/Using_IndexedDB) +- Iniciando transacciones: {{domxref("IDBDatabase")}} +- Usando transacciones: {{domxref("IDBTransaction")}} +- Estableciendo un rango de claves: {{domxref("IDBKeyRange")}} +- Recuperación y edición de tus datos: {{domxref("IDBObjectStore")}} +- Utilización de cursores: {{domxref("IDBCursor")}} +- Ejemplo de referencia: [To-do Notifications](https://github.com/mdn/to-do-notifications/tree/gh-pages) ([ver ejemplo _live_](http://mdn.github.io/to-do-notifications/).) diff --git a/files/es/web/api/indexeddb_api/index.md b/files/es/web/api/indexeddb_api/index.md index 3153338625a5da..f0c4614b8b61d0 100644 --- a/files/es/web/api/indexeddb_api/index.md +++ b/files/es/web/api/indexeddb_api/index.md @@ -3,74 +3,60 @@ title: IndexedDB slug: Web/API/IndexedDB_API translation_of: Web/API/IndexedDB_API --- -

    {{ SeeCompatTable() }}

    +{{ SeeCompatTable() }} -

    IndexedDB es una API de bajo nivel que ofrece almacenamiento en el cliente de cantidades significativas de datos estructurados, incluyendo archivos y blobs. Para búsquedas de alto rendimiento en esos datos usa índices. Mientras DOM Storage es útil para el almacenamiento de pequeñas cantidades de datos, no es útil para almacenar grandes cantidades de datos estructurados. IndexedDB proporciona una solución.

    +IndexedDB es una API de bajo nivel que ofrece almacenamiento en el cliente de cantidades significativas de datos estructurados, incluyendo archivos y blobs. Para búsquedas de alto rendimiento en esos datos usa índices. Mientras [DOM Storage](/es/docs/DOM/Storage "en-US/docs/DOM/Storage") es útil para el almacenamiento de pequeñas cantidades de datos, no es útil para almacenar grandes cantidades de datos estructurados. IndexedDB proporciona una solución. -

    Esta página es básicamente el punto de entrada para la descripción técnica de los objetos de la API. Si necesita algo elemental, debería consultar ;Conceptos básicos acerca de IndexedDB. Para más detalles, vea Usando IndexedDB.

    +Esta página es básicamente el punto de entrada para la descripción técnica de los objetos de la API. Si necesita algo elemental, debería consultar ;[Conceptos básicos acerca de IndexedDB](/es/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB). Para más detalles, vea [Usando IndexedDB](/es/docs/IndexedDB/Using_IndexedDB). -

    IndexedDB provee APIs separados para un acceso síncrono o asíncrono. El API síncrono está destinado a ser usado únicamente dentro de Web Workers, pero no será implementado aún por cualquier navegador. El API asíncrono trabaja con o sin Web Workers.

    +IndexedDB provee APIs separados para un acceso síncrono o asíncrono. El API síncrono está destinado a ser usado únicamente dentro de [Web Workers](/es/docs/DOM/Worker "Worker"), pero no será implementado aún por cualquier navegador. El API asíncrono trabaja con o sin Web Workers. -

    API Asíncrono

    +## API Asíncrono -

    Los métodos del API Asíncrono, retornan sin bloquear el hilo de llamada. Para obtener un acceso asíncrono a la base de datos, use open() en el atributo indexedDB de un objeto window. Este método retorna un objeto IDBRequest (IDBOpenDBRequest); operaciones asíncronas se comunicarán con la aplicación que llama, disparando eventos en los objetos IDBRequest.

    +Los métodos del API Asíncrono, retornan sin bloquear el hilo de llamada. Para obtener un acceso asíncrono a la base de datos, use [`open`](/en-US/docs/IndexedDB/IDBFactory#open "en-US/docs/IndexedDB/IDBFactory#open")() en el atributo [`indexedDB`](/en-US/docs/IndexedDB/IDBEnvironment#attr_indexedDB "en-US/docs/IndexedDB/IDBEnvironment#attr indexedDB") de un objeto [window](/es/docs/DOM/window "en-US/docs/DOM/window"). Este método retorna un objeto IDBRequest (IDBOpenDBRequest); operaciones asíncronas se comunicarán con la aplicación que llama, disparando eventos en los objetos IDBRequest. -
    -

    Nota: El objeto indexedDB se prefija en las versiones antiguas de los navegadores (propiedad mozIndexedDB para Gecko < 16, webkitIndexedDB en Chrome, y msIndexedDB en IE 10).

    -
    +> **Nota:** Nota: El objeto `indexedDB` se prefija en las versiones antiguas de los navegadores (propiedad `mozIndexedDB` para Gecko < 16, `webkitIndexedDB` en Chrome, y `msIndexedDB` en IE 10). -
      -
    • IDBFactory provee acceso a la base de datos. Esta es la interface implementada por el objeto global indexedDB y es el punto de entrada para la API.
    • -
    • IDBCursor itera sobre los objetos de almacenamiento y de índices.
    • -
    • IDBCursorWithValue itera sobre los objetos de almacenamiento y de índices y retorna el valor actual del cursor.
    • -
    • IDBDatabase representa una conexión a la base de datos. Es la única manera de realizar una transacción en la base de datos.
    • -
    • IDBEnvironment provee acceso a la base de datos, desde el lado del cliente. Está implementada por el objeto window.
    • -
    • IDBIndex provee acceso a la metadata de un índice.
    • -
    • IDBKeyRange define un rango de claves.
    • -
    • IDBObjectStore representa un objeto de almacenamiento.
    • -
    • IDBOpenDBRequest representa un requerimiento para abrir una base de datos.
    • -
    • IDBRequest provee acceso a los resultados de los requerimientos asíncronos a la base de datos y a los objetos database. Es lo que se obtiene cuando se llama a un método asíncrono.
    • -
    • IDBTransaction representa una transacción. Cuando Ud. crea una transacción en la base de datos, especifica el alcance (como a que objetos store desea tener acceso), y determina la clase de acceso (sólo lectura o escritura) que desea tener.
    • -
    • IDBVersionChangeEvent indica que la versión de la base de datos ha cambiado.
    • -
    +- [`IDBFactory`](/es/docs/IndexedDB/IDBFactory "en-US/docs/IndexedDB/IDBFactory") provee acceso a la base de datos. Esta es la interface implementada por el objeto global `indexedDB` y es el punto de entrada para la API. +- [`IDBCursor`](/es/docs/IndexedDB/IDBCursor "en-US/docs/IndexedDB/IDBCursor") itera sobre los objetos de almacenamiento y de índices. +- [`IDBCursorWithValue`](/es/docs/IndexedDB/IDBCursorWithValue) itera sobre los objetos de almacenamiento y de índices y retorna el valor actual del cursor. +- [`IDBDatabase`](/es/docs/IndexedDB/IDBDatabase "en-US/docs/IndexedDB/IDBDatabase") representa una conexión a la base de datos. Es la única manera de realizar una transacción en la base de datos. +- [`IDBEnvironment`](/es/docs/IndexedDB/IDBEnvironment "en-US/docs/IndexedDB/IDBEnvironment") provee acceso a la base de datos, desde el lado del cliente. Está implementada por el objeto [window](/../en-US/docs/DOM/window "../en-US/docs/DOM/window"). +- [`IDBIndex`](/es/docs/IndexedDB/IDBIndex "en-US/docs/IndexedDB/IDBIndex") provee acceso a la metadata de un índice. +- [`IDBKeyRange`](/en-US/docs/IndexedDB/IDBKeyRange "en-US/docs/IndexedDB/KeyRange") define un rango de claves. +- [`IDBObjectStore`](/es/docs/IndexedDB/IDBObjectStore "en-US/docs/IndexedDB/IDBObjectStore") representa un objeto de almacenamiento. +- [`IDBOpenDBRequest`](/es/docs/IndexedDB/IDBOpenDBRequest "en-US/docs/IndexedDB/IDBOpenDBRequest") representa un requerimiento para abrir una base de datos. +- [`IDBRequest`](/es/docs/IndexedDB/IDBRequest "en-US/docs/IndexedDB/IDBRequest") provee acceso a los resultados de los requerimientos asíncronos a la base de datos y a los objetos database. Es lo que se obtiene cuando se llama a un método asíncrono. +- [`IDBTransaction`](/es/docs/IndexedDB/IDBTransaction "en-US/docs/IndexedDB/IDBTransaction") representa una transacción. Cuando Ud. crea una transacción en la base de datos, especifica el alcance (como a que objetos store desea tener acceso), y determina la clase de acceso (sólo lectura o escritura) que desea tener. +- [`IDBVersionChangeEvent`](/es/docs/IndexedDB/IDBVersionChangeEvent "IDBVersionChangeEvent") indica que la versión de la base de datos ha cambiado. -

    Una versión anterior de la especificación también define estas -ahora removidas- interfaces. Éstas son documentadas todavía, en caso de que necesite actualizar código escrito previamente:

    +Una versión anterior de la especificación también define estas -ahora removidas- interfaces. Éstas son documentadas todavía, en caso de que necesite actualizar código escrito previamente: -
      -
    • IDBVersionChangeRequest representa una solicitud para cambiar la versión de una base de datos. La manera de cambiar la versión de la base de datos ahora es diferente (llamando IDBFactory.open() sin llamar también a IDBDatabase.setVersion()), y la interfaz IDBOpenDBRequest tiene ahora la funcionalidad de la eliminada IDBVersionChangeRequest.
    • -
    • IDBDatabaseException {{ obsolete_inline() }} representa las condiciones de excepción que se pueden encontrar mientras se ejecutan operaciones en la base de datos.
    • -
    +- [`IDBVersionChangeRequest`](/en-US/docs/IndexedDB/IDBVersionChangeRequest "https://developer.mozilla.org/en-US/docs/IndexedDB/IDBVersionChangeRequest") representa una solicitud para cambiar la versión de una base de datos. La manera de cambiar la versión de la base de datos ahora es diferente (llamando [`IDBFactory.open()`](/es/docs/IndexedDB/IDBFactory#open "en-US/docs/IndexedDB/IDBFactory#open") sin llamar también a [`IDBDatabase.setVersion()`]( "en-US/docs/IndexedDB/IDBDatabase#setVersion()")), y la interfaz [`IDBOpenDBRequest`](/es/docs/IndexedDB/IDBOpenDBRequest "en-US/docs/IndexedDB/IDBOpenDBRequest") tiene ahora la funcionalidad de la eliminada `IDBVersionChangeRequest`. +- [`IDBDatabaseException `](/en-US/docs/IndexedDB/IDBDatabaseException "en-US/docs/IndexedDB/DatabaseException"){{ obsolete_inline() }} representa las condiciones de excepción que se pueden encontrar mientras se ejecutan operaciones en la base de datos. -

    Hay también una versión sincrónica de la API. La API síncrona no ha sido implementada en cualquier navegador. Está destinada a ser usada con WebWorkers.

    +Hay también una [versión sincrónica de la API](/es/docs/IndexedDB/Syncronous_API "/en-US/docs/IndexedDB/SyncronousAPI"). La API síncrona no ha sido implementada en cualquier navegador. Está destinada a ser usada con [WebWorkers](/es/docs/DOM/Using_web_workers "https://developer.mozilla.org/en-US/docs/Using_web_workers"). -

    Límites de almacenamiento

    +## Límites de almacenamiento -

    No existe un límite de tamaño para un elemento simple de la base de datos. Sin embargo, puede haber un límite en el tamaño de cada base de datos IndexedDB. Este límite (y la forma en que la interfaz de usuario la hace valer) puede variar de una navegador a otro:

    +No existe un límite de tamaño para un elemento simple de la base de datos. Sin embargo, puede haber un límite en el tamaño de cada base de datos IndexedDB. Este límite (y la forma en que la interfaz de usuario la hace valer) puede variar de una navegador a otro: - +- Firefox: no hay límite en el tamaño de una base de datos IndexedDB. La interfaz de usuario solicita permiso para almacenar blobs de más de 50MB. Este límite puede ser modificado mediante la preferencia dom.indexedDB.warningQuota (que está definida en ). +- Google Chrome: vea [https://developers.google.com/chrome...rage#temporary](https://developers.google.com/chrome/whitepapers/storage#temporary) -

    Ejemplo

    +## Ejemplo -

    Un claro ejemplo para lo que IndexedDB puede ser utilizado en la web, es el ejemplo de Marco Castelluccio, ganador del DevDerby IndexedDB Mozilla. La demostración ganadora fue eLibri, una biblioteca y una aplicación de lectura de libros electrónicos.

    +Un claro ejemplo para lo que IndexedDB puede ser utilizado en la web, es el ejemplo de Marco Castelluccio, ganador del DevDerby IndexedDB Mozilla. La demostración ganadora fue [eLibri](/en-US/demos/detail/elibri "https://developer.mozilla.org/en-US/demos/detail/elibri"), una biblioteca y una aplicación de lectura de libros electrónicos. +## Ver también - -

    Ver también

    - - +- [Conceptos básicos acerca de IndexedDB](/es/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB "en-US/docs/IndexedDB/Basic Concepts Behind IndexedDB") +- [Usando IndexedDB](/es/docs/IndexedDB/Using_IndexedDB "en-US/docs/IndexedDB/IndexedDB primer") +- [Almacenando imágenes y archivos en IndexedDB](http://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/) +- [Una lista simple de PENDIENTES usando HTML5 IndexedDB](http://www.html5rocks.com/tutorials/indexeddb/todo/). Nota("Este tutorial está basado en una antigua versión de la especificación y no funciona en los navegadores actualizados. por ejemplo, todavía usa el método actualmente eliminado `setVersion()`.") +- [Especificación de la API para Indexed Database](http://www.w3.org/TR/IndexedDB/) +- [IndexedDB — El alamcén en su navegador](http://msdn.microsoft.com/en-us/scriptjunkie/gg679063.aspx) +- [Soporte IndexedDB en navegadores](http://caniuse.com/indexeddb) +- [Ejemplos IndexedDB](http://nparashuram.com/IndexedDB/trialtool/index.html) +- [IndexedDB Polyfill](https://github.com/axemclion/IndexedDBShim) para navegadores que sólo soportan WebSQL (p.e. mobile WebKit) +- [JQuery IndexedDB plugin](http://nparashuram.com/IndexedDBShim/) diff --git a/files/es/web/api/indexeddb_api/using_indexeddb/index.md b/files/es/web/api/indexeddb_api/using_indexeddb/index.md index e847b9d7809acb..6e6d64223a96e5 100644 --- a/files/es/web/api/indexeddb_api/using_indexeddb/index.md +++ b/files/es/web/api/indexeddb_api/using_indexeddb/index.md @@ -13,97 +13,96 @@ tags: translation_of: Web/API/IndexedDB_API/Using_IndexedDB original_slug: Web/API/IndexedDB_API/Usando_IndexedDB --- -
    -

    IndexedDB es una manera de almacenar datos dentro del navegador del usuario. Debido a que permite la creación de aplicaciones con habilidades de consulta enriquecidas, con independencia de la disponibilidad de la red, sus aplicaciones pueden trabajar tanto en línea como fuera de línea.

    -
    +IndexedDB es una manera de almacenar datos dentro del navegador del usuario. Debido a que permite la creación de aplicaciones con habilidades de consulta enriquecidas, con independencia de la disponibilidad de la red, sus aplicaciones pueden trabajar tanto en línea como fuera de línea. -

    Acerca de este documento

    +## Acerca de este documento -

    Este tutorial es una guía sobre el uso de la API asíncrona de IndexedDB. Si no está familiarizado con IndexedDB, por favor consulte primero Conceptos Básicos Acerca de IndexedDB.

    +Este tutorial es una guía sobre el uso de la API asíncrona de IndexedDB. Si no está familiarizado con IndexedDB, por favor consulte primero [Conceptos Básicos Acerca de IndexedDB](/en/IndexedDB/Basic_Concepts_Behind_IndexedDB "en/IndexedDB/Basic Concepts Behind IndexedDB"). -

    Para la documentación de referencia sobre la API de IndexedDB, vea el artículo IndexedDB y sus subpaginas, que documentan los tipos de objetos usados por IndexedDB, así como los métodos síncronos y asíncronos.

    +Para la documentación de referencia sobre la API de IndexedDB, vea el artículo [IndexedDB](/es/docs/IndexedDB "https://developer.mozilla.org/en/IndexedDB") y sus subpaginas, que documentan los tipos de objetos usados por IndexedDB, así como los métodos síncronos y asíncronos. -

    Patrones Básicos

    +## Patrones Básicos -

    El patrón básico que indexedDB propone es:

    +El patrón básico que indexedDB propone es: -
      -
    1. Abrir una base de datos.
    2. -
    3. Crear un objeto de almacenamiento en la base de datos.
    4. -
    5. Iniciar una transacción y hacer una petición para hacer alguna operación de la base de datos, tal como añadir o recuperar datos.
    6. -
    7. -
      Espere a que se complete la operación por la escucha de la clase correcta de eventos DOM .
      -
    8. -
    9. -
      Hacer algo con el resultado (El cual puede ser encontrado en el objeto de la petición).
      -
    10. -
    +1. Abrir una base de datos. +2. Crear un objeto de almacenamiento en la base de datos. +3. Iniciar una transacción y hacer una petición para hacer alguna operación de la base de datos, tal como añadir o recuperar datos. +4. Espere a que se complete la operación por la escucha de la clase correcta de eventos DOM . +5. Hacer algo con el resultado (El cual puede ser encontrado en el objeto de la petición). -

    Con esos grandes rasgos en mente, seremos más concretos.

    +Con esos grandes rasgos en mente, seremos más concretos. -

    Creando y estructurando el almacenamiento

    +## Creando y estructurando el almacenamiento -

    Como las especificaciones están todavía elaborandose, las implementaciones actuales de indexedDB dependen de los navegadores. Hasta que la especificación se haya consolidado, los proveedores de navegadores pueden tener diferentes implementaciones de los estandares de indexedDB. Una vez se alcance el consenso en el estandar, los proveedores implementarán la API sin prefijos. En algunas implementaciones ya fueron removidos los prefijos: Internet Explorer 10, Firefox 16, Chrome 24. Cuando utilizan un prefijo, los navegadores basados en gecko usan el prefijo moz , mientras que los navegadores basados en WebKit usan el prefijo webkit.

    +Como las especificaciones están todavía elaborandose, las implementaciones actuales de indexedDB dependen de los navegadores. Hasta que la especificación se haya consolidado, los proveedores de navegadores pueden tener diferentes implementaciones de los estandares de indexedDB. Una vez se alcance el consenso en el estandar, los proveedores implementarán la API sin prefijos. En algunas implementaciones ya fueron removidos los prefijos: Internet Explorer 10, Firefox 16, Chrome 24. Cuando utilizan un prefijo, los navegadores basados en gecko usan el prefijo `moz` , mientras que los navegadores basados en WebKit usan el prefijo `webkit`. -

    Usando una versión experimental de IndexedDB

    +### Usando una versión experimental de IndexedDB -

    En caso que usted quiera probar su código en navegadores que todavía usen un prefijo, puede usar el siguiente codigo:

    +En caso que usted quiera probar su código en navegadores que todavía usen un prefijo, puede usar el siguiente codigo: -
    // En la siguiente línea, puede incluir prefijos de implementación que quiera probar.
    +```js
    +// En la siguiente línea, puede incluir prefijos de implementación que quiera probar.
     window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
     // No use "var indexedDB = ..." Si no está en una función.
     // Por otra parte, puedes necesitar referencias a algun objeto window.IDB*:
     window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction;
     window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;
    -// (Mozilla nunca ha prefijado estos objetos, por lo tanto no necesitamos window.mozIDB*)
    +// (Mozilla nunca ha prefijado estos objetos, por lo tanto no necesitamos window.mozIDB*) +``` -

    Hay que tener cuidado con las implementaciones que usan un prefijo ya que puede ser inestables, incompletas, o usen una versión antigua de la especificación. En producción se recomienda usar el código sin prefijos. Es preferible no tener soporte para un navegador a decir que lo tiene y fallar en ello :

    +Hay que tener cuidado con las implementaciones que usan un prefijo ya que puede ser inestables, incompletas, o usen una versión antigua de la especificación. En producción se recomienda usar el código sin prefijos. Es preferible no tener soporte para un navegador a decir que lo tiene y fallar en ello : -
    if (!window.indexedDB) {
    +```js
    +if (!window.indexedDB) {
         window.alert("Su navegador no soporta una versión estable de indexedDB. Tal y como las características no serán validas");
     }
    -
    +``` -

    Abriendo una base de datos

    +### Abriendo una base de datos -

    Iniciamos todo el proceso así:

    +Iniciamos todo el proceso así: -
    // dejamos abierta nuestra base de datos
    +```js
    +// dejamos abierta nuestra base de datos
     var request = window.indexedDB.open("MyTestDatabase", 3);
    -
    +``` -

    ¿Lo has visto? Abrir una base de datos es igual que cualquier otra operación — solo tienes que "solicitarla" (request).

    +¿Lo has visto? Abrir una base de datos es igual que cualquier otra operación — solo tienes que "solicitarla" (request). -

    La solicitud de apertura no abre la base de datos o inicia la transacción de inmediato. La llamada a la función open() retornan unos objetos IDBOpenDBRequest, cuyo resultado, correcto o erróneo, se maneja en un evento. Alguna otra función asincrónica en indexedDB hace lo mismo - Devolver un objeto IDBRequest que disparará un evento con el resultado o el error. El resultado para la función de abrir es una instancia de un IDBDatabase.

    +La solicitud de apertura no abre la base de datos o inicia la transacción de inmediato. La llamada a la función `open()` retornan unos objetos `IDBOpenDBRequest,` cuyo resultado, correcto o erróneo, se maneja en un evento. Alguna otra función asincrónica en indexedDB hace lo mismo - Devolver un objeto [`IDBRequest`](/es/docs/IndexedDB/IDBRequest) que disparará un evento con el resultado o el error. El resultado para la función de abrir es una instancia de un `IDBDatabase.` -

    El segundo parámetro para el método open es la versión de la base de datos. La versión de la base de datos determina el esquema - El almacen de objectos en la base de datos y su estructura. Si la base de datos no existe, es creada y se dispara un evento onupgradeneeded de inmediato, permitiéndote proveer una actualización de la estructura e índices en la función que capture dicho evento. Se verá más adelante en Actualizando la versión de la base de datos.

    +El segundo parámetro para el método open es la versión de la base de datos. La versión de la base de datos determina el esquema - El almacen de objectos en la base de datos y su estructura. Si la base de datos no existe, es creada y se dispara un evento `onupgradeneeded` de inmediato, permitiéndote proveer una actualización de la estructura e índices en la función que capture dicho evento. Se verá más adelante en [Actualizando la versión de la base de datos](#Updating_the_version_of_the_database). -
    -

    Importante: El número de versión es un unsigned long. Por lo tanto significa que puede ser un entero muy grande. También significa que si usas un flotante será convertido en un entero más cercano y la transacción puede no ser iniciada, el evento upgradeneeded no se desencadenará. Por ejemplo no use 2.4 como un número de versión ya que será igual que la 2:

    +> **Advertencia:** **Importante**: El número de versión es un `unsigned long`. Por lo tanto significa que puede ser un entero muy grande. También significa que si usas un flotante será convertido en un entero más cercano y la transacción puede no ser iniciada, el evento `upgradeneeded `no se desencadenará. Por ejemplo no use 2.4 como un número de versión ya que será igual que la 2: +> +> ```js +> var request = indexedDB.open("MyTestDatabase", 2.4); // Esto no se hace, la versión será redondeada a 2 +> ``` -
    var request = indexedDB.open("MyTestDatabase", 2.4); // Esto no se hace, la versión será redondeada a 2
    -
    +#### Generando manipuladores -

    Generando manipuladores

    +La primera cosa que usted querrá hacer con la totalidad de las peticiones que usted genera es agregar controladores de éxito y de error: -

    La primera cosa que usted querrá hacer con la totalidad de las peticiones que usted genera es agregar controladores de éxito y de error:

    - -
    request.onerror = function(event) {
    +```js
    +request.onerror = function(event) {
       // Hacer algo con request.errorCode!
     };
     request.onsuccess = function(event) {
       // Hacer algo con request.result!
    -};
    +}; +``` -

    ¿Cuál de las dos funciones, onSuccess () o onerror (), se vuelve a llamar? Si todo tiene éxito, un evento de éxito (es decir, un evento DOM cuya propiedad tipo se establece en el "éxito") se dispara con la solicitud como su objetivo. Una vez que se dispara, la función onSuccess () a petición se activa con el evento de éxito como argumento. De lo contrario, si había algún problema, un evento de error (es decir, un evento DOM cuyo tipo de propiedad se establece en "error") se dispara a petición. Esto desencadena la función onerror () con el evento de error como argumento.

    +¿Cuál de las dos funciones, onSuccess () o onerror (), se vuelve a llamar? Si todo tiene éxito, un evento de éxito (es decir, un evento DOM cuya propiedad tipo se establece en el "éxito") se dispara con la solicitud como su objetivo. Una vez que se dispara, la función onSuccess () a petición se activa con el evento de éxito como argumento. De lo contrario, si había algún problema, un evento de error (es decir, un evento DOM cuyo tipo de propiedad se establece en "error") se dispara a petición. Esto desencadena la función onerror () con el evento de error como argumento. -

    La API IndexedDB está diseñada para minimizar la necesidad de control de errores, por lo que no es probable que veamos muchos eventos de error (al menos, no una vez que estás acostumbrado a la API). En el caso de la apertura de una base de datos, sin embargo, hay algunas condiciones comunes que generan eventos de error. El problema más común se produce cuando el usuario ha decidido no dar, a su aplicación web, el permiso para crear una base de datos. Uno de los principales objetivos de diseño de IndexedDB es permitir que grandes cantidades de datos se almacenen para su uso sin conexión a internet. (Para obtener más información sobre la cantidad de almacenamiento que puede tener para cada navegador, consulte Límites de almacenamiento.)

    +La API IndexedDB está diseñada para minimizar la necesidad de control de errores, por lo que no es probable que veamos muchos eventos de error (al menos, no una vez que estás acostumbrado a la API). En el caso de la apertura de una base de datos, sin embargo, hay algunas condiciones comunes que generan eventos de error. El problema más común se produce cuando el usuario ha decidido no dar, a su aplicación web, el permiso para crear una base de datos. Uno de los principales objetivos de diseño de IndexedDB es permitir que grandes cantidades de datos se almacenen para su uso sin conexión a internet. (Para obtener más información sobre la cantidad de almacenamiento que puede tener para cada navegador, consulte [Límites de almacenamiento](/es/docs/Web/API/IndexedDB_API#Storage_limits).) -

    Obviamente, los navegadores no permitirán que alguna red de publicidad o sitio web malicioso pueda contaminar su ordenador, por ello los navegadores utilizan un diálogo para indicar al usuario la primera vez que cualquier aplicación web determinada intente abrir una IndexedDB para el almacenamiento. El usuario puede optar por permitir o denegar el acceso. Además, el almacenamiento IndexedDB en los modos de privacidad navegadores sólo dura en memoria hasta que la sesión de incógnito haya sido cerrada (modo de navegación privada para el modo de Firefox e Incognito para Chrome, pero en Firefox no está implementado a partir de noviembre 2015 por lo que no puede utilizar IndexedDB en Firefox navegación privada en absoluto).

    +Obviamente, los navegadores no permitirán que alguna red de publicidad o sitio web malicioso pueda contaminar su ordenador, por ello los navegadores utilizan un diálogo para indicar al usuario la primera vez que cualquier aplicación web determinada intente abrir una IndexedDB para el almacenamiento. El usuario puede optar por permitir o denegar el acceso. Además, el almacenamiento IndexedDB en los modos de privacidad navegadores sólo dura en memoria hasta que la sesión de incógnito haya sido cerrada (modo de navegación privada para el modo de Firefox e Incognito para Chrome, pero en Firefox [no está implementado](https://bugzilla.mozilla.org/show_bug.cgi?id=781982) a partir de noviembre 2015 por lo que no puede utilizar IndexedDB en Firefox navegación privada en absoluto). -

    Ahora, asumiendo que el usuario acepta su solicitud para crear una base de datos, y que ha recibido un evento de éxito para activar la devolución de llamada de éxito; ¿Que sigue? La solicitud aquí se generó con una llamada a indexedDB.open (), por lo request.result es una instancia de IDBDatabase, y que sin duda quieren ahorrar para más adelante. Su código podría ser algo como esto:

    +Ahora, asumiendo que el usuario acepta su solicitud para crear una base de datos, y que ha recibido un evento de éxito para activar la devolución de llamada de éxito; ¿Que sigue? La solicitud aquí se generó con una llamada a indexedDB.open (), por lo request.result es una instancia de IDBDatabase, y que sin duda quieren ahorrar para más adelante. Su código podría ser algo como esto: -
    var db;
    +```js
    +var db;
     var request = indexedDB.open("MyTestDatabase");
     request.onerror = function(event) {
       alert("Why didn't you allow my web app to use IndexedDB?!");
    @@ -111,97 +110,75 @@ request.onerror = function(event) {
     request.onsuccess = function(event) {
       db = request.result;
     };
    -
    +``` -

    Manejando errores

    +#### Manejando errores -

    Como se mencionó anteriormente, los eventos de error de burbujas. Eventos de error se dirigen a la solicitud que generó el error, entonces el evento se propaga a la operación, y finalmente con el objeto de base de datos. Si desea evitar la adición de controladores de errores a cada solicitud, en su lugar puede añadir un solo controlador de errores en el objeto de base de datos, así:

    +Como se mencionó anteriormente, los eventos de error de burbujas. Eventos de error se dirigen a la solicitud que generó el error, entonces el evento se propaga a la operación, y finalmente con el objeto de base de datos. Si desea evitar la adición de controladores de errores a cada solicitud, en su lugar puede añadir un solo controlador de errores en el objeto de base de datos, así: -
    db.onerror = function(event) {
    +```js
    +db.onerror = function(event) {
       // Generic error handler for all errors targeted at this database's
       // requests!
       alert("Database error: " + event.target.errorCode);
     };
    -
    +``` -

    Uno de los errores más comunes posibles al abrir una base de datos es VER_ERR. Indica que la versión de la base de datos almacenada en el disco es mayor que la versión que está intentando abrir. Este es un caso de error que siempre debe ser manejado por el gestor de errores.

    +Uno de los errores más comunes posibles al abrir una base de datos es `VER_ERR`. Indica que la versión de la base de datos almacenada en el disco es mayor que la versión que está intentando abrir. Este es un caso de error que siempre debe ser manejado por el gestor de errores. -

    Creación o actualización de la versión de la base de datos

    +### Creación o actualización de la versión de la base de datos -

    Cuando se crea una nueva base de datos o se aumenta el número de versión de una base de datos existente (mediante la especificación de un número de versión más alto de lo que hizo antes, en Cómo abrir una base de datos), el evento onupgradeneeded se activará y un objeto IDBVersionChangeEvent será pasado a cualquier controlador de eventos onversionchange establecido en request.result (es decir, db en el ejemplo). En el controlador para el evento upgradeneeded, se debe crear los almacenes de objetos necesarios para esta versión de la base de datos:

    +Cuando se crea una nueva base de datos o se aumenta el número de versión de una base de datos existente (mediante la especificación de un número de versión más alto de lo que hizo antes, en [Cómo abrir una base de datos](#cómo_abrir_una_base_de_datos)), el evento onupgradeneeded se activará y un objeto [IDBVersionChangeEvent](/es/docs/Web/API/IDBVersionChangeEvent) será pasado a cualquier controlador de eventos `onversionchange` establecido en `request.result` (es decir, db en el ejemplo). En el controlador para el evento `upgradeneeded`, se debe crear los almacenes de objetos necesarios para esta versión de la base de datos: -
    // Este evento solamente está implementado en navegadores recientes
    +```js
    +// Este evento solamente está implementado en navegadores recientes
     request.onupgradeneeded = function(event) {
       var db = event.target.result;
     
       // Crea un almacén de objetos (objectStore) para esta base de datos
       var objectStore = db.createObjectStore("name", { keyPath: "myKey" });
    -};
    - -

    En este caso, la base de datos ya tendrá los almacenes de objetos de la versión anterior de la base de datos, por lo que no tiene que crear estos almacenes de objetos de nuevo. Sólo es necesario crear nuevos almacenes de objetos, o eliminar las tiendas de objetos de la versión anterior que ya no son necesarios. Si necesita cambiar un almacén de objetos existentes (por ejemplo, para cambiar la ruta de acceso clave keyPath), entonces se debe eliminar el antiguo almacén de objetos y crear de nuevo con las nuevas opciones. (Tenga en cuenta que esto borrará la información en el almacén de objetos Si usted necesita guardar esa información, usted debe leerlo y guardarlo en otro lugar antes de actualizar la base de datos.)

    - -

    Tratar de crear un almacén de objetos con un nombre que ya existe (o tratando de eliminar un almacén de objetos con un nombre que no existe) lanzará un error.

    - -

    Si el evento onupgradeneeded retorna éxito, entonces se activará el manejador onsuccess de la solicitud de base de datos abierta.

    - -

    Blink / Webkit soportan la versión actual de la especificación, tal como fue liberado en Chrome 23+ y Opera 17+ ; IE10+ también lo soporta. Implementaciones mas viejas o distintas no implementan la versión actual de la especificación, y por lo tanto no son compatibles todavía con el indexedDB.open (nombre, versión).onupgradeneeded . Para obtener más información sobre cómo actualizar la versión de la base de datos en Webkit/Blink mas viejos, consulte el artículo de referencia IDBDatabase.

    - -

    Estructuración de la base de datos

    - -

    Ahora para estructurar la base de datos. IndexedDB usa almacenes de datos (object stores) en lugar de tablas, y una base de datos puede contener cualquier número de almacenes. Cuando un valor es almacenado, se le asocia con una clave. Existen diversas maneras en que una clave pude ser indicada dependiendo de si el almacén usa una ruta de clave o generador.

    - -

    La siguiente table muetra las distintas formas en que las claves pueden ser indicadas:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Ruta de clave(keyPath)Generador de clave (autoIncrement)Descripción
    NoNoEste almacén puede contener cualquier tipo de valor, incluso valores primitivos como números y cadenas. Se debe indicar un argumento de clave distinto cada vez que se agregue un nuevo valor.
    SiNoEste almacén de objetos solo puede contener objetos de JavaScript. Los objetos deben tener una propiedad con el mismo nombre que la ruta de clave.
    NoSiEste objeto puede contener cualquier tipo de valor. La clave es generada automáticamente, o se puede indicar un argumento de clave distinto si se quiere usar una clave específica.
    SiSi -

    Este almacén de objetos solo puede contener objetos de JavaScript. Usualmente una clave es generada y dicho valor es almacenado en el objeto en una propiedad con el mismo nombre que la ruta de clave. Sin embargo, si dicha propiedad ya existe en el objeto, el valor de esa propuiedad es usado como clave en lugar de generar una nueva.

    -
    - -

    También se puede crear índices en cualquer almacén de objetos, siempre y cuando el almacén contenga objets, y no primitivos. Un índice permite buscar valores contenidos en el almacén usando el valor de una propiedad del objeto almacenado, en lugar de la clave del mismo.

    - -

    Adicionalmente, los índices tienen la habilidad para hacer cumplir restricciones simples en los datos almacendos. Al indicar la bandera unique al crear el índice, el índice asegurará que no se puedan almacenar dos objetos que tengan el mismo valor para la clave del índice. Así, por ejemplo si se tiene un almacén de objetos que contiene un set de personas, y se desea asegurar que no existan dos personas con el mismo email, se puede usar un índice con la bandera unique activada para forzar esto.

    - -

    Esto puede sonar confuso, pero un ejemplo simple debe ilustrar el concepto. Primero, definiremos alguna información de clientes para usar en nuestro ejemplo:

    - -
    // Así se ve nuestra información de clientes.
    +};
    +```
    +
    +En este caso, la base de datos ya tendrá los almacenes de objetos de la versión anterior de la base de datos, por lo que no tiene que crear estos almacenes de objetos de nuevo. Sólo es necesario crear nuevos almacenes de objetos, o eliminar las tiendas de objetos de la versión anterior que ya no son necesarios. Si necesita cambiar un almacén de objetos existentes (por ejemplo, para cambiar la ruta de acceso clave `keyPath`), entonces se debe eliminar el antiguo almacén de objetos y crear de nuevo con las nuevas opciones. (Tenga en cuenta que esto borrará la información en el almacén de objetos Si usted necesita guardar esa información, usted debe leerlo y guardarlo en otro lugar antes de actualizar la base de datos.)
    +
    +Tratar de crear un almacén de objetos con un nombre que ya existe (o tratando de eliminar un almacén de objetos con un nombre que no existe) lanzará un error.
    +
    +Si el evento `onupgradeneeded` retorna éxito, entonces se activará el manejador `onsuccess` de la solicitud de base de datos abierta.
    +
    +Blink / Webkit soportan la versión actual de la especificación, tal como fue liberado en Chrome 23+ y Opera 17+ ; IE10+ también lo soporta. Implementaciones mas viejas o distintas no implementan la versión actual de la especificación, y por lo tanto no son compatibles todavía con el `indexedDB.open (nombre, versión).onupgradeneeded` . Para obtener más información sobre cómo actualizar la versión de la base de datos en Webkit/Blink mas viejos, consulte el artículo de referencia [IDBDatabase](/es/docs/Web/API/IDBDatabase "https://developer.mozilla.org/en/IndexedDB/IDBDatabase#setVersion()_.0A.0ADeprecated").
    +
    +### Estructuración de la base de datos
    +
    +Ahora para estructurar la base de datos. IndexedDB usa almacenes de datos (object stores) en lugar de tablas, y una base de datos puede contener cualquier número de almacenes. Cuando un valor es almacenado, se le asocia con una clave. Existen diversas maneras en que una clave pude ser indicada dependiendo de si el almacén usa una [ruta de clave](https://developer.mozilla.org/en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_keypath) o [generador](https://developer.mozilla.org/en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_keygenerator).
    +
    +La siguiente table muetra las distintas formas en que las claves pueden ser indicadas:
    +
    +| Ruta de clave(`keyPath`) | Generador de clave (`autoIncrement`) | Descripción                                                                                                                                                                                                                                                                                                                                   |
    +| ------------------------ | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    +| No                       | No                                   | Este almacén puede contener cualquier tipo de valor, incluso valores primitivos como números y cadenas. Se debe indicar un argumento de clave distinto cada vez que se agregue un nuevo valor.                                                                                                                                                |
    +| Si                       | No                                   | Este almacén de objetos solo puede contener objetos de JavaScript. Los objetos deben tener una propiedad con el mismo nombre que la ruta de clave.                                                                                                                                                                                            |
    +| No                       | Si                                   | Este objeto puede contener cualquier tipo de valor. La clave es generada automáticamente, o se puede indicar un argumento de clave distinto si se quiere usar una clave específica.                                                                                                                                                           |
    +| Si                       | Si                                   | Este almacén de objetos solo puede contener objetos de JavaScript. Usualmente una clave es generada y dicho valor es almacenado en el objeto en una propiedad con el mismo nombre que la ruta de clave. Sin embargo, si dicha propiedad ya existe en el objeto, el valor de esa propuiedad es usado como clave en lugar de generar una nueva. |
    +
    +También se puede crear índices en cualquer almacén de objetos, siempre y cuando el almacén contenga objets, y no primitivos. Un índice permite buscar valores contenidos en el almacén usando el valor de una propiedad del objeto almacenado, en lugar de la clave del mismo.
    +
    +Adicionalmente, los índices tienen la habilidad para hacer cumplir restricciones simples en los datos almacendos. Al indicar la bandera `unique` al crear el índice, el índice asegurará que no se puedan almacenar dos objetos que tengan el mismo valor para la clave del índice. Así, por ejemplo si se tiene un almacén de objetos que contiene un set de personas, y se desea asegurar que no existan dos personas con el mismo email, se puede usar un índice con la bandera `unique` activada para forzar esto.
    +
    +Esto puede sonar confuso, pero un ejemplo simple debe ilustrar el concepto. Primero, definiremos alguna información de clientes para usar en nuestro ejemplo:
    +
    +```js
    +// Así se ve nuestra información de clientes.
     const customerData = [
       { ssn: "444-44-4444", name: "Bill", age: 35, email: "bill@company.com" },
       { ssn: "555-55-5555", name: "Donna", age: 32, email: "donna@home.org" }
     ];
    -
    +``` -

    Ahora, creemos una IndexedDB para almacenar los datos:

    +Ahora, creemos una IndexedDB para almacenar los datos: -
    const dbName = "the_name";
    +```js
    +const dbName = "the_name";
     
     var request = indexedDB.open(dbName, 2);
     
    @@ -233,25 +210,26 @@ request.onupgradeneeded = function(event) {
         }
       }
     };
    -
    +``` -

    Como se indicó previamente, onupgradeneeded es el único lugar donde se puede alterar la estructura de la base de datos. En el, se puede crear y borrar almacenes de objetos y construir y remover índices.

    +Como se indicó previamente, `onupgradeneeded` es el único lugar donde se puede alterar la estructura de la base de datos. En el, se puede crear y borrar almacenes de objetos y construir y remover índices. -
    Los almacenes de datos son creados con una llamada a createObjectStore(). El método toma como parámetros el nombre del almacén y un objeto. A pesar de que el segundo parámetro es opcional, es muy importante, porque permite definir propiedades opcionales importantes y refinar el tipo de almacén que se desea crear. En este caso, se pregunta por un almacén llamado "customers" y se define la clave, que es la propiedad que indica que un objeto en el almacén es único. La propiedad en este ejemplo es "ssn" (Social Security Number) ya que los números de seguridad social está garantizado que sea único. "ssn" debe estar presente en cada objeto que se guarda al almacén.
    +Los almacenes de datos son creados con una llamada a `createObjectStore()`. El método toma como parámetros el nombre del almacén y un objeto. A pesar de que el segundo parámetro es opcional, es muy importante, porque permite definir propiedades opcionales importantes y refinar el tipo de almacén que se desea crear. En este caso, se pregunta por un almacén llamado "customers" y se define la clave, que es la propiedad que indica que un objeto en el almacén es único. La propiedad en este ejemplo es "ssn" (Social Security Number) ya que los números de seguridad social está garantizado que sea único. "ssn" debe estar presente en cada objeto que se guarda al almacén. -

    También se solicitó crear un índice llamado "name" que se fija en la propiedad name de los objetos almacenados. Así como con createObjectStore(), createIndex() toma un objeto opcional options que refina el tipo de índice que se desea crear. Agregar objetos que no tengan una propiedad name funcionará, pero los objetos no aparecerán en el índice "name"

    +También se solicitó crear un índice llamado "name" que se fija en la propiedad `name `de los objetos almacenados. Así como con `createObjectStore()`, `createIndex()` toma un objeto opcional `options` que refina el tipo de índice que se desea crear. Agregar objetos que no tengan una propiedad `name` funcionará, pero los objetos no aparecerán en el índice "name" -
    Ahora se pueden obtener los clientes almacenados usando su ssn directamente del almacen, o usando su nombre a través del índice. Para aprender como hacer esto, vea la sección El uso de un índice
    +Ahora se pueden obtener los clientes almacenados usando su `ssn` directamente del almacen, o usando su nombre a través del índice. Para aprender como hacer esto, vea la sección [El uso de un índice](#El_uso_de_un_índice) -

    El uso de un generador de claves

    +### El uso de un generador de claves -

    Indicar la bandera autoIncrement cuando se crea el almacén habilitará el generador de claves para dicho almacén. Por defecto esta bandera no está marcada.

    +Indicar la bandera `autoIncrement `cuando se crea el almacén habilitará el generador de claves para dicho almacén. Por defecto esta bandera no está marcada. -

    Con el generador de claves, la clave será generada automáticamente a medida que se agreguen valores al almacén. El número actual de un generador de claves siempre se establece en 1 cuando se creal el almacén por primera vez. Básicamente la nueva clave autogenerada es incrementada en 1 basada en la llave anterior. El numero actual para un generador de claves nunca disminuye, salvo como resultado de operaciones de base de datos que sean revertidos, por ejemplo, cuando la transacción de base de datos es abortada. Por lo tanto borrar un registro o incluso borrar todos los registros de un almacén nunca afecta al generador de claves

    +Con el generador de claves, la clave será generada automáticamente a medida que se agreguen valores al almacén. El número actual de un generador de claves siempre se establece en 1 cuando se creal el almacén por primera vez. Básicamente la nueva clave autogenerada es incrementada en 1 basada en la llave anterior. El numero actual para un generador de claves nunca disminuye, salvo como resultado de operaciones de base de datos que sean revertidos, por ejemplo, cuando la transacción de base de datos es abortada. Por lo tanto borrar un registro o incluso borrar todos los registros de un almacén nunca afecta al generador de claves -

    Se puede crear otro almacén de objetos con generador de claves como se muestra abajo:

    +Se puede crear otro almacén de objetos con generador de claves como se muestra abajo: -
    // Abrir la indexedDB.
    +```js
    +// Abrir la indexedDB.
     var request = indexedDB.open(dbName, 3);
     
     request.onupgradeneeded = function (event) {
    @@ -263,48 +241,50 @@ request.onupgradeneeded = function (event) {
     
         // Because the "names" object store has the key generator, the key for the name value is generated automatically.
         // The added records would be like:
    -    // key : 1 => value : "Bill"
    -    // key : 2 => value : "Donna"
    +    // key : 1 => value : "Bill"
    +    // key : 2 => value : "Donna"
         for (var i in customerData) {
             objStore.add(customerData[i].name);
         }
    -}
    +} +``` -

    Para más detalles acerca del generador de claves, por favor ver "W3C Key Generators".

    +Para más detalles acerca del generador de claves, por favor ver ["W3C Key Generators"](http://www.w3.org/TR/IndexedDB/#key-generator-concept). -

    Añadir, recuperación y eliminación de datos

    +## Añadir, recuperación y eliminación de datos -

    Antes que haga algo con su nueva base de datos , necesita comenzar una transacción. Transactions come from the database object, and you have to specify which object stores you want the transaction to span. Once you are inside the transaction, you can access the object stores that hold your data and make your requests. Next, you need to decide if you're going to make changes to the database or if you just need to read from it. Transactions have three available modes: readonly, readwrite, and versionchange.

    +Antes que haga algo con su nueva base de datos , necesita comenzar una transacción. Transactions come from the database object, and you have to specify which object stores you want the transaction to span. Once you are inside the transaction, you can access the object stores that hold your data and make your requests. Next, you need to decide if you're going to make changes to the database or if you just need to read from it. Transactions have three available modes: `readonly`, `readwrite`, and `versionchange`. -

    To change the "schema" or structure of the database—which involves creating or deleting object stores or indexes—the transaction must be in versionchange mode. This transaction is opened by calling the {{domxref("IDBFactory.open")}} method with a version specified. (In WebKit browsers, which have not implemented the latest specifcation, the {{domxref("IDBFactory.open")}} method takes only one parameter, the name of the database; then you must call {{domxref("IDBVersionChangeRequest.setVersion")}} to establish the versionchange transaction.)

    +To change the "schema" or structure of the database—which involves creating or deleting object stores or indexes—the transaction must be in `versionchange` mode. This transaction is opened by calling the {{domxref("IDBFactory.open")}} method with a `version` specified. (In WebKit browsers, which have not implemented the latest specifcation, the {{domxref("IDBFactory.open")}} method takes only one parameter, the `name` of the database; then you must call {{domxref("IDBVersionChangeRequest.setVersion")}} to establish the `versionchange` transaction.) -

    To read the records of an existing object store, the transaction can either be in readonly or readwrite mode. To make changes to an existing object store, the transaction must be in readwrite mode. You open such transactions with {{domxref("IDBDatabase.transaction")}}. The method accepts two parameters: the storeNames (the scope, defined as an array of object stores that you want to access) and the mode (readonly or readwrite) for the transaction. The method returns a transaction object containing the {{domxref("IDBIndex.objectStore")}} method, which you can use to access your object store. By default, where no mode is specified, transactions open in readonly mode.

    +To read the records of an existing object store, the transaction can either be in `readonly` or `readwrite` mode. To make changes to an existing object store, the transaction must be in `readwrite` mode. You open such transactions with {{domxref("IDBDatabase.transaction")}}. The method accepts two parameters: the `storeNames` (the scope, defined as an array of object stores that you want to access) and the `mode` (`readonly` or `readwrite`) for the transaction. The method returns a transaction object containing the {{domxref("IDBIndex.objectStore")}} method, which you can use to access your object store. By default, where no mode is specified, transactions open in `readonly` mode. -

    You can speed up data access by using the right scope and mode in the transaction. Here are a couple of tips:

    +You can speed up data access by using the right scope and mode in the transaction. Here are a couple of tips: -
      -
    • When defining the scope, specify only the object stores you need. This way, you can run multiple transactions with non-overlapping scopes concurrently.
    • -
    • Only specify a readwrite transaction mode when necessary. You can concurrently run multiple readonly transactions with overlapping scopes, but you can have only one readwrite transaction for an object store. To learn more, see the definition for transactions in the Basic Concepts article.
    • -
    +- When defining the scope, specify only the object stores you need. This way, you can run multiple transactions with non-overlapping scopes concurrently. +- Only specify a `readwrite` transaction mode when necessary. You can concurrently run multiple `readonly` transactions with overlapping scopes, but you can have only one `readwrite` transaction for an object store. To learn more, see the definition for _[transactions](/es/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB#Database)_ in the [Basic Concepts](/es/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB) article. -

    Agregar datos a la base de datos

    +### Agregar datos a la base de datos -

    If you've just created a database, then you probably want to write to it. Here's what that looks like:

    +If you've just created a database, then you probably want to write to it. Here's what that looks like: -
    var transaction = db.transaction(["customers"], "readwrite");
    +```js
    +var transaction = db.transaction(["customers"], "readwrite");
     // Note: Older experimental implementations use the deprecated constant IDBTransaction.READ_WRITE instead of "readwrite".
     // In case you want to support such an implementation, you can write:
    -// var transaction = db.transaction(["customers"], IDBTransaction.READ_WRITE);
    +// var transaction = db.transaction(["customers"], IDBTransaction.READ_WRITE); +``` -

    The transaction() function takes two arguments (though one is optional) and returns a transaction object. The first argument is a list of object stores that the transaction will span. You can pass an empty array if you want the transaction to span all object stores, but don't do it because the spec says an empty array should generate an InvalidAccessError. If you don't specify anything for the second argument, you get a read-only transaction. Since you want to write to it here you need to pass the "readwrite" flag.

    +The `transaction()` function takes two arguments (though one is optional) and returns a transaction object. The first argument is a list of object stores that the transaction will span. You can pass an empty array if you want the transaction to span all object stores, but don't do it because the spec says an empty array should generate an InvalidAccessError. If you don't specify anything for the second argument, you get a read-only transaction. Since you want to write to it here you need to pass the `"readwrite"` flag. -

    Now that you have a transaction you need to understand its lifetime. Transactions are tied very closely to the event loop. If you make a transaction and return to the event loop without using it then the transaction will become inactive. The only way to keep the transaction active is to make a request on it. When the request is finished you'll get a DOM event and, assuming that the request succeeded, you'll have another opportunity to extend the transaction during that callback. If you return to the event loop without extending the transaction then it will become inactive, and so on. As long as there are pending requests the transaction remains active. Transaction lifetimes are really very simple but it might take a little time to get used to. A few more examples will help, too. If you start seeing TRANSACTION_INACTIVE_ERR error codes then you've messed something up.

    +Now that you have a transaction you need to understand its lifetime. Transactions are tied very closely to the event loop. If you make a transaction and return to the event loop without using it then the transaction will become inactive. The only way to keep the transaction active is to make a request on it. When the request is finished you'll get a DOM event and, assuming that the request succeeded, you'll have another opportunity to extend the transaction during that callback. If you return to the event loop without extending the transaction then it will become inactive, and so on. As long as there are pending requests the transaction remains active. Transaction lifetimes are really very simple but it might take a little time to get used to. A few more examples will help, too. If you start seeing `TRANSACTION_INACTIVE_ERR` error codes then you've messed something up. -

    Transactions can receive DOM events of three different types: error, abort, and complete. We've talked about the way that error events bubble, so a transaction receives error events from any requests that are generated from it. A more subtle point here is that the default behavior of an error is to abort the transaction in which it occurred. Unless you handle the error by first calling preventDefault() on the error event then doing something else, the entire transaction is rolled back. This design forces you to think about and handle errors, but you can always add a catchall error handler to the database if fine-grained error handling is too cumbersome. If you don't handle an error event or if you call abort() on the transaction, then the transaction is rolled back and an abort event is fired on the transaction. Otherwise, after all pending requests have completed, you'll get a complete event. If you're doing lots of database operations, then tracking the transaction rather than individual requests can certainly aid your sanity.

    +Transactions can receive DOM events of three different types: `error`, `abort`, and `complete`. We've talked about the way that `error` events bubble, so a transaction receives error events from any requests that are generated from it. A more subtle point here is that the default behavior of an error is to abort the transaction in which it occurred. Unless you handle the error by first calling `preventDefault()` on the error event then doing something else, the entire transaction is rolled back. This design forces you to think about and handle errors, but you can always add a catchall error handler to the database if fine-grained error handling is too cumbersome. If you don't handle an error event or if you call `abort()` on the transaction, then the transaction is rolled back and an `abort` event is fired on the transaction. Otherwise, after all pending requests have completed, you'll get a `complete` event. If you're doing lots of database operations, then tracking the transaction rather than individual requests can certainly aid your sanity. -

    Now that you have a transaction, you'll need to get the object store from it. Transactions only let you have an object store that you specified when creating the transaction. Then you can add all the data you need.

    +Now that you have a transaction, you'll need to get the object store from it. Transactions only let you have an object store that you specified when creating the transaction. Then you can add all the data you need. -
    // Do something when all the data is added to the database.
    +```js
    +// Do something when all the data is added to the database.
     transaction.oncomplete = function(event) {
       alert("All done!");
     };
    @@ -319,26 +299,30 @@ for (var i in customerData) {
       request.onsuccess = function(event) {
         // event.target.result == customerData[i].ssn;
       };
    -}
    +} +``` -

    The result of a request generated from a call to add() is the key of the value that was added. So in this case, it should equal the ssn property of the object that was added, since the object store uses the ssn property for the key path. Note that the add() function requires that no object already be in the database with the same key. If you're trying to modify an existing entry, or you don't care if one exists already, you can use the put() function, as shown below in the Updating an entry in the database section.

    +The `result` of a request generated from a call to `add()` is the key of the value that was added. So in this case, it should equal the `ssn` property of the object that was added, since the object store uses the `ssn` property for the key path. Note that the `add()` function requires that no object already be in the database with the same key. If you're trying to modify an existing entry, or you don't care if one exists already, you can use the `put()` function, as shown below in the [Updating an entry in the database](#updating_an_entry_in_the_database) section. -

    Extracción de datos de la base de datos

    +### Extracción de datos de la base de datos -

    Removing data is very similar:

    +Removing data is very similar: -
    var request = db.transaction(["customers"], "readwrite")
    +```js
    +var request = db.transaction(["customers"], "readwrite")
                     .objectStore("customers")
                     .delete("444-44-4444");
     request.onsuccess = function(event) {
       // It's gone!
    -};
    +}; +``` -

    Obtener datos de la base de datos

    +### Obtener datos de la base de datos -

    Now that the database has some info in it, you can retrieve it in several ways. First, the simple get(). You need to provide the key to retrieve the value, like so:

    +Now that the database has some info in it, you can retrieve it in several ways. First, the simple `get()`. You need to provide the key to retrieve the value, like so: -
    var transaction = db.transaction(["customers"]);
    +```js
    +var transaction = db.transaction(["customers"]);
     var objectStore = transaction.objectStore("customers");
     var request = objectStore.get("444-44-4444");
     request.onerror = function(event) {
    @@ -347,34 +331,30 @@ request.onerror = function(event) {
     request.onsuccess = function(event) {
       // Do something with the request.result!
       alert("Name for SSN 444-44-4444 is " + request.result.name);
    -};
    +}; +``` -

    That's a lot of code for a "simple" retrieval. Here's how you can shorten it up a bit, assuming that you handle errors at the database level:

    +That's a lot of code for a "simple" retrieval. Here's how you can shorten it up a bit, assuming that you handle errors at the database level: -
    db.transaction("customers").objectStore("customers").get("444-44-4444").onsuccess = function(event) {
    +```js
    +db.transaction("customers").objectStore("customers").get("444-44-4444").onsuccess = function(event) {
       alert("Name for SSN 444-44-4444 is " + event.target.result.name);
    -};
    - -

    See how this works? Since there's only one object store, you can avoid passing a list of object stores you need in your transaction and just pass the name as a string. Also, you're only reading from the database, so you don't need a "readwrite" transaction. Calling transaction() with no mode specified gives you a "readonly" transaction. Another subtlety here is that you don't actually save the request object to a variable. Since the DOM event has the request as its target you can use the event to get to the result property.

    +}; +``` -
    -

    Note: You can speed up data access by limiting the scope and mode in the transaction. Here are a couple of tips:

    +See how this works? Since there's only one object store, you can avoid passing a list of object stores you need in your transaction and just pass the name as a string. Also, you're only reading from the database, so you don't need a `"readwrite"` transaction. Calling `transaction()` with no mode specified gives you a `"readonly"` transaction. Another subtlety here is that you don't actually save the request object to a variable. Since the DOM event has the request as its target you can use the event to get to the `result` property. -
      -
    • -

      When defining the scope, specify only the object stores you need. This way, you can run multiple transactions with non-overlapping scopes concurrently.

      -
    • -
    • -

      Only specify a readwrite transaction mode when necessary. You can concurrently run multiple readonly transactions with overlapping scopes, but you can have only one readwrite transaction for an object store. To learn more, see the definition for transactions in the Basic Concepts article.

      -
    • -
    -
    +> **Nota:** You can speed up data access by limiting the scope and mode in the transaction. Here are a couple of tips: +> +> - When defining the [scope](#scope), specify only the object stores you need. This way, you can run multiple transactions with non-overlapping scopes concurrently. +> - Only specify a `readwrite` transaction mode when necessary. You can concurrently run multiple `readonly` transactions with overlapping scopes, but you can have only one `readwrite` transaction for an object store. To learn more, see the definition for [_transactions_ in the Basic Concepts article](/es/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_transaction). -

    Actualización de una entrada en la base de datos

    +### Actualización de una entrada en la base de datos -

    Now we've retrieved some data, updating it and inserting it back into the IndexedDB is pretty simple. Let's update the previous example somewhat:

    +Now we've retrieved some data, updating it and inserting it back into the IndexedDB is pretty simple. Let's update the previous example somewhat: -
    var objectStore = db.transaction(["customers"], "readwrite").objectStore("customers");
    +```js
    +var objectStore = db.transaction(["customers"], "readwrite").objectStore("customers");
     var request = objectStore.get("444-44-4444");
     request.onerror = function(event) {
       // Handle errors!
    @@ -394,19 +374,19 @@ request.onsuccess = function(event) {
        requestUpdate.onsuccess = function(event) {
          // Success - the data is updated!
        };
    -};
    +}; +``` -

    So here we're creating an objectStore and requesting a customer record out of it, identified by its ssn value (444-44-4444). We then put the result of that request in a variable (data), update the age property of this object, then create a second request (requestUpdate) to put the customer record back into the objectStore, overwriting the previous value.

    +So here we're creating an `objectStore` and requesting a customer record out of it, identified by its ssn value (`444-44-4444`). We then put the result of that request in a variable (`data`), update the `age` property of this object, then create a second request (`requestUpdate`) to put the customer record back into the `objectStore`, overwriting the previous value. -
    -

    Note that in this case we've had to specify a readwrite transaction because we want to write to the database, not just read out of it.

    -
    +> **Nota:** that in this case we've had to specify a `readwrite` transaction because we want to write to the database, not just read out of it. -

    El uso de un cursor

    +### El uso de un cursor -

    Using get() requires that you know which key you want to retrieve. If you want to step through all the values in your object store, then you can use a cursor. Here's what it looks like:

    +Using `get()` requires that you know which key you want to retrieve. If you want to step through all the values in your object store, then you can use a cursor. Here's what it looks like: -
    var objectStore = db.transaction("customers").objectStore("customers");
    +```js
    +var objectStore = db.transaction("customers").objectStore("customers");
     
     objectStore.openCursor().onsuccess = function(event) {
       var cursor = event.target.result;
    @@ -417,13 +397,15 @@ objectStore.openCursor().onsuccess = function(event) {
       else {
         alert("No more entries!");
       }
    -};
    +}; +``` -

    The openCursor() function takes several arguments. First, you can limit the range of items that are retrieved by using a key range object that we'll get to in a minute. Second, you can specify the direction that you want to iterate. In the above example, we're iterating over all objects in ascending order. The success callback for cursors is a little special. The cursor object itself is the result of the request (above we're using the shorthand, so it's event.target.result). Then the actual key and value can be found on the key and value properties of the cursor object. If you want to keep going, then you have to call continue() on the cursor. When you've reached the end of the data (or if there were no entries that matched your openCursor() request) you still get a success callback, but the result property is undefined.

    +The` openCursor()` function takes several arguments. First, you can limit the range of items that are retrieved by using a key range object that we'll get to in a minute. Second, you can specify the direction that you want to iterate. In the above example, we're iterating over all objects in ascending order. The success callback for cursors is a little special. The cursor object itself is the `result` of the request (above we're using the shorthand, so it's `event.target.result`). Then the actual key and value can be found on the `key` and `value` properties of the cursor object. If you want to keep going, then you have to call `continue()` on the cursor. When you've reached the end of the data (or if there were no entries that matched your `openCursor()` request) you still get a success callback, but the `result` property is `undefined`. -

    One common pattern with cursors is to retrieve all objects in an object store and add them to an array, like this:

    +One common pattern with cursors is to retrieve all objects in an object store and add them to an array, like this: -
    var customers = [];
    +```js
    +var customers = [];
     
     objectStore.openCursor().onsuccess = function(event) {
       var cursor = event.target.result;
    @@ -434,32 +416,36 @@ objectStore.openCursor().onsuccess = function(event) {
       else {
         alert("Got all customers: " + customers);
       }
    -};
    - -
    -

    Note: Mozilla has also implemented getAll() to handle this case (and getAllKeys(), which is currently hidden behind the dom.indexedDB.experimental preference in about:config). these aren't part of the IndexedDB standard, so may disappear in the future. We've included them because we think they're useful. The following code does precisely the same thing as above:

    - -
    objectStore.getAll().onsuccess = function(event) {
    -  alert("Got all customers: " + event.target.result);
    -};
    +}; +``` -

    There is a performance cost associated with looking at the value property of a cursor, because the object is created lazily. When you use getAll() for example, Gecko must create all the objects at once. If you're just interested in looking at each of the keys, for instance, it is much more efficient to use a cursor than to use getAll(). If you're trying to get an array of all the objects in an object store, though, use getAll().

    -
    +> **Nota:** Note: Mozilla has also implemented `getAll()` to handle this case (and `getAllKeys()`, which is currently hidden behind the `dom.indexedDB.experimental` preference in about:config). these aren't part of the IndexedDB standard, so may disappear in the future. We've included them because we think they're useful. The following code does precisely the same thing as above: +> +> ```js +> objectStore.getAll().onsuccess = function(event) { +> alert("Got all customers: " + event.target.result); +> }; +> ``` +> +> There is a performance cost associated with looking at the `value` property of a cursor, because the object is created lazily. When you use `getAll()` for example, Gecko must create all the objects at once. If you're just interested in looking at each of the keys, for instance, it is much more efficient to use a cursor than to use `getAll()`. If you're trying to get an array of all the objects in an object store, though, use `getAll()`. -

    El uso de un índice

    +### El uso de un índice -

    Storing customer data using the SSN as a key is logical since the SSN uniquely identifies an individual. (Whether this is a good idea for privacy is a different question, and outside the scope of this article.) If you need to look up a customer by name, however, you'll need to iterate over every SSN in the database until you find the right one. Searching in this fashion would be very slow, so instead you can use an index.

    +Storing customer data using the SSN as a key is logical since the SSN uniquely identifies an individual. (Whether this is a good idea for privacy is a different question, and outside the scope of this article.) If you need to look up a customer by name, however, you'll need to iterate over every SSN in the database until you find the right one. Searching in this fashion would be very slow, so instead you can use an index. -
    var index = objectStore.index("name");
    +```js
    +var index = objectStore.index("name");
     index.get("Donna").onsuccess = function(event) {
       alert("Donna's SSN is " + event.target.result.ssn);
    -};
    +}; +``` -

    The "name" cursor isn't unique, so there could be more than one entry with the name set to "Donna". In that case you always get the one with the lowest key value.

    +The "name" cursor isn't unique, so there could be more than one entry with the `name` set to `"Donna"`. In that case you always get the one with the lowest key value. -

    If you need to access all the entries with a given name you can use a cursor. You can open two different types of cursors on indexes. A normal cursor maps the index property to the object in the object store. A key cursor maps the index property to the key used to store the object in the object store. The differences are illustrated here:

    +If you need to access all the entries with a given `name` you can use a cursor. You can open two different types of cursors on indexes. A normal cursor maps the index property to the object in the object store. A key cursor maps the index property to the key used to store the object in the object store. The differences are illustrated here: -
    // Using a normal cursor to grab whole customer record objects
    +```js
    +// Using a normal cursor to grab whole customer record objects
     index.openCursor().onsuccess = function(event) {
       var cursor = event.target.result;
       if (cursor) {
    @@ -478,13 +464,15 @@ index.openKeyCursor().onsuccess = function(event) {
         alert("Name: " + cursor.key + ", SSN: " + cursor.value);
         cursor.continue();
       }
    -};
    +}; +``` -

    Especificación de la gama y la dirección de los cursores

    +### Especificación de la gama y la dirección de los cursores -

    If you would like to limit the range of values you see in a cursor, you can use an IDBKeyRange object and pass it as the first argument to openCursor() or openKeyCursor(). You can make a key range that only allows a single key, or one that has a lower or upper bound, or one that has both a lower and upper bound. The bound may be "closed" (i.e., the key range includes the given value(s)) or "open" (i.e., the key range does not include the given value(s)). Here's how it works:

    +If you would like to limit the range of values you see in a cursor, you can use an `IDBKeyRange` object and pass it as the first argument to `openCursor()` or `openKeyCursor()`. You can make a key range that only allows a single key, or one that has a lower or upper bound, or one that has both a lower and upper bound. The bound may be "closed" (i.e., the key range includes the given value(s)) or "open" (i.e., the key range does not include the given value(s)). Here's how it works: -
    // Only match "Donna"
    +```js
    +// Only match "Donna"
     var singleKeyRange = IDBKeyRange.only("Donna");
     
     // Match anything past "Bill", including "Bill"
    @@ -506,45 +494,53 @@ index.openCursor(boundKeyRange).onsuccess = function(event) {
         // Do something with the matches.
         cursor.continue();
       }
    -};
    +}; +``` -

    Sometimes you may want to iterate in descending order rather than in ascending order (the default direction for all cursors). Switching direction is accomplished by passing prev to the openCursor() function as the second argument:

    +Sometimes you may want to iterate in descending order rather than in ascending order (the default direction for all cursors). Switching direction is accomplished by passing `prev` to the `openCursor()` function as the second argument: -
    objectStore.openCursor(boundKeyRange, "prev").onsuccess = function(event) {
    +```js
    +objectStore.openCursor(boundKeyRange, "prev").onsuccess = function(event) {
       var cursor = event.target.result;
       if (cursor) {
         // Do something with the entries.
         cursor.continue();
       }
    -};
    +}; +``` -

    If you just want to specify a change of direction but not constrain the results shown, you can just pass in null as the first argument:

    +If you just want to specify a change of direction but not constrain the results shown, you can just pass in null as the first argument: -
    objectStore.openCursor(null, "prev").onsuccess = function(event) {
    +```js
    +objectStore.openCursor(null, "prev").onsuccess = function(event) {
       var cursor = event.target.result;
       if (cursor) {
         // Do something with the entries.
         cursor.continue();
       }
    -};
    +}; +``` -

    Since the "name" index isn't unique, there might be multiple entries where name is the same. Note that such a situation cannot occur with object stores since the key must always be unique. If you wish to filter out duplicates during cursor iteration over indexes, you can pass nextunique (or prevunique if you're going backwards) as the direction parameter. When nextunique or prevunique is used, the entry with the lowest key is always the one returned.

    +Since the "name" index isn't unique, there might be multiple entries where `name` is the same. Note that such a situation cannot occur with object stores since the key must always be unique. If you wish to filter out duplicates during cursor iteration over indexes, you can pass `nextunique` (or `prevunique` if you're going backwards) as the direction parameter. When `nextunique` or `prevunique` is used, the entry with the lowest key is always the one returned. -
    index.openKeyCursor(null, "nextunique").onsuccess = function(event) {
    +```js
    +index.openKeyCursor(null, "nextunique").onsuccess = function(event) {
       var cursor = event.target.result;
       if (cursor) {
         // Do something with the entries.
         cursor.continue();
       }
    -};
    +}; +``` -

    Please see "IDBCursor Constants" for the valid direction arguments.

    +Please see "[IDBCursor Constants](/es/docs/Web/API/IDBCursor?redirectlocale=en-US&redirectslug=IndexedDB%2FIDBCursor#Constants)" for the valid direction arguments. -

    Cambios Versión mientras que una aplicación web está abierto en otra pestaña

    +## Cambios Versión mientras que una aplicación web está abierto en otra pestaña -

    When your web app changes in such a way that a version change is required for your database, you need to consider what happens if the user has the old version of your app open in one tab and then loads the new version of your app in another. When you call open() with a greater version than the actual version of the database, all other open databases must explicitly acknowledge the request before you can start making changes to the database (an onblocked event is fired until tey are closed or reloaded). Here's how it works:

    +When your web app changes in such a way that a version change is required for your database, you need to consider what happens if the user has the old version of your app open in one tab and then loads the new version of your app in another. When you call `open()` with a greater version than the actual version of the database, all other open databases must explicitly acknowledge the request before you can start making changes to the database (an `onblocked` event is fired until tey are closed or reloaded). Here's how it works: -
    var openReq = mozIndexedDB.open("MyTestDatabase", 2);
    +```js
    +var openReq = mozIndexedDB.open("MyTestDatabase", 2);
     
     openReq.onblocked = function(event) {
       // If some other tab is loaded with the database, then it needs to be closed
    @@ -575,164 +571,166 @@ function useDatabase(db) {
     
       // Do stuff with the database.
     }
    -
    +``` -

    Seguridad

    +## Seguridad -

    IndexedDB uses the same-origin principle, which means that it ties the store to the origin of the site that creates it (typically, this is the site domain or subdomain), so it cannot be accessed by any other origin.

    +IndexedDB uses the same-origin principle, which means that it ties the store to the origin of the site that creates it (typically, this is the site domain or subdomain), so it cannot be accessed by any other origin. -

    It's important to note that IndexedDB doesn't work for content loaded into a frame from another site (either {{ HTMLElement("frame") }} or {{ HTMLElement("iframe") }}. This is a security and privacy measure and can be considered analogous the blocking of third-party cookies. For more details, see {{ bug(595307) }}.

    +It's important to note that IndexedDB doesn't work for content loaded into a frame from another site (either {{ HTMLElement("frame") }} or {{ HTMLElement("iframe") }}. This is a security and privacy measure and can be considered analogous the blocking of third-party cookies. For more details, see {{ bug(595307) }}. -

    Warning About Browser Shutdown

    +## Warning About Browser Shutdown -

    When the browser shuts down (e.g., when the user selects Exit or clicks the Close button), any pending IndexedDB transactions are (silently) aborted — they will not complete, and they will not trigger the error handler. Since the user can exit the browser at any time, this means that you cannot rely upon any particular transaction to complete or to know that it did not complete. There are several implications of this behavior.

    +When the browser shuts down (e.g., when the user selects Exit or clicks the Close button), any pending IndexedDB transactions are (silently) aborted — they will not complete, and they will not trigger the error handler. Since the user can exit the browser at any time, this means that you cannot rely upon any particular transaction to complete or to know that it did not complete. There are several implications of this behavior. -

    First, you should take care to always leave your database in a consistent state at the end of every transaction. For example, suppose that you are using IndexedDB to store a list of items that you allow the user to edit. You save the list after the edit by clearing the object store and then writing out the new list. If you clear the object store in one transaction and write the new list in another transaction, there is a danger that the browser will close after the clear but before the write, leaving you with an empty database. To avoid this, you should combine the clear and the write into a single transaction.

    +First, you should take care to always leave your database in a consistent state at the end of every transaction. For example, suppose that you are using IndexedDB to store a list of items that you allow the user to edit. You save the list after the edit by clearing the object store and then writing out the new list. If you clear the object store in one transaction and write the new list in another transaction, there is a danger that the browser will close after the clear but before the write, leaving you with an empty database. To avoid this, you should combine the clear and the write into a single transaction. -

    Second, you should never tie database transactions to unload events. If the unload event is triggered by the browser closing, any transactions created in the unload event handler will never complete. An intuitive approach to maintaining some information across browser sessions is to read it from the database when the browser (or a particular page) is opened, update it as the user interacts with the browser, and then save it to the database when the browser (or page) closes. However, this will not work. The database transactions will be created in the unload event handler, but because they are asynchronous they will be aborted before they can execute.

    +Second, you should never tie database transactions to unload events. If the unload event is triggered by the browser closing, any transactions created in the unload event handler will never complete. An intuitive approach to maintaining some information across browser sessions is to read it from the database when the browser (or a particular page) is opened, update it as the user interacts with the browser, and then save it to the database when the browser (or page) closes. However, this will not work. The database transactions will be created in the unload event handler, but because they are asynchronous they will be aborted before they can execute. -

    In fact, there is no way to guarantee that IndexedDB transactions will complete, even with normal browser shutdown. See {{ bug(870645) }}.

    +In fact, there is no way to guarantee that IndexedDB transactions will complete, even with normal browser shutdown. See {{ bug(870645) }}. -

    Full IndexedDB example

    +## Full IndexedDB example -

    HTML Content

    +### HTML Content -
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    +```html
    +
     
    -    <h1>IndexedDB Demo: storing blobs, e-publication example</h1>
    -    <div class="note">
    -      <p>
    +    

    IndexedDB Demo: storing blobs, e-publication example

    +
    +

    Works and tested with: - </p> - <div id="compat"> - </div> - </div> - - <div id="msg"> - </div> - - <form id="register-form"> - <table> - <tbody> - <tr> - <td> - <label for="pub-title" class="required"> +

    +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + +
    + + + +
    + +
    + + +
    +
    + +
    + + + + + + + + + + + +
    + + + +
    + + + +
    +
    + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
      +
    +
    +``` + +### CSS Content + +```css +body { font-size: 0.8em; font-family: Sans-Serif; } @@ -817,23 +815,22 @@ input { .destructive:active { background-color: red; } -
    - -

    +``` -

    JavaScript Content

    +### JavaScript Content -
    (function () {
    +```js
    +(function () {
       var COMPAT_ENVS = [
    -    ['Firefox', ">= 16.0"],
    +    ['Firefox', ">= 16.0"],
         ['Google Chrome',
    -     ">= 24.0 (you may need to get Google Chrome Canary), NO Blob storage support"]
    +     ">= 24.0 (you may need to get Google Chrome Canary), NO Blob storage support"]
       ];
       var compat = $('#compat');
       compat.empty();
    -  compat.append('<ul id="compat-list"></ul>');
    +  compat.append('
      '); COMPAT_ENVS.forEach(function(val, idx, array) { - $('#compat-list').append('<li>' + val[0] + ': ' + val[1] + '</li>'); + $('#compat-list').append('
    • ' + val[0] + ': ' + val[1] + '
    • '); }); const DB_NAME = 'mdn-demo-indexeddb-epublications'; @@ -924,8 +921,8 @@ input { // Thus the count text below will be displayed before the actual pub list // (not that it is algorithmically important in this case). req.onsuccess = function(evt) { - pub_msg.append('<p>There are <strong>' + evt.target.result + - '</strong> record(s) in the object store.</p>'); + pub_msg.append('

      There are ' + evt.target.result + + ' record(s) in the object store.

      '); }; req.onerror = function(evt) { console.error("add error", this.error); @@ -943,17 +940,17 @@ input { req = store.get(cursor.key); req.onsuccess = function (evt) { var value = evt.target.result; - var list_item = $('<li>' + + var list_item = $('
    • ' + '[' + cursor.key + '] ' + '(biblioid: ' + value.biblioid + ') ' + value.title + - '</li>'); + '
    • '); if (value.year != null) list_item.append(' - ' + value.year); - if (value.hasOwnProperty('blob') && + if (value.hasOwnProperty('blob') && typeof value.blob != 'undefined') { - var link = $('<a href="' + cursor.key + '">File</a>'); + var link = $('File'); link.on('click', function() { return false; }); link.on('mouseenter', function(evt) { setInViewer(evt.target.getAttribute('href')); }); @@ -979,7 +976,7 @@ input { function newViewerFrame() { var viewer = $('#pub-viewer'); viewer.empty(); - var iframe = $('<iframe />'); + var iframe = $('