The global indexedDB
read-only property provides a mechanism for applications to asynchronously access the capabilities of indexed databases.
indexedDB
Value
An 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:
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
|
4.4
|
25
|
22
|
14
|
8
|
1.5
|
worker_support |
24
|
12
|
37
|
10
|
15
|
10
|
≤37
|
25
|
37
|
14
|
10
|
1.5
|
See also
- Using IndexedDB
- Starting transactions:
IDBDatabase
- Using transactions:
IDBTransaction
- Setting a range of keys:
IDBKeyRange
- Retrieving and making changes to your data:
IDBObjectStore
- Using cursors:
IDBCursor
- Reference example: To-do Notifications (view example live.)
© 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