indexedDB

The global indexedDB read-only property provides a mechanism for applications to asynchronously access the capabilities of indexed databases.

Syntax

var IDBFactory = self.indexedDB;

Value

An IDBFactory object.

Example

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:

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

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
indexedDB
24
12
16
10
10
15
7
≤37
25
22
14
8
1.5
worker_support
24
12
37
10
15
10
≤37
25
37
14
10
1.5

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/indexedDB