docs.rodeo

MDN Web Docs mirror

Window: indexedDB property

{{APIRef("IndexedDB")}} 

The indexedDB read-only property of the {{domxref("Window")}}  interface provides a mechanism for applications to asynchronously access the capabilities of indexed databases.

Value

An {{domxref("IDBFactory")}}  object.

Examples

The following code creates a request for a database to be opened asynchronously, after which the database is opened when the request’s onsuccess handler is fired:

let db;
function openDB() {
  const DBOpenRequest = window.indexedDB.open("toDoList");
  DBOpenRequest.onsuccess = (e) => {
    db = DBOpenRequest.result;
  };
}

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN