The global indexedDB
read-only property provides a mechanism for applications to asynchronously access the capabilities of indexed databases.
The global indexedDB
read-only property provides a mechanism for applications to asynchronously access the capabilities of indexed databases.
An IDBFactory
object.
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:
js
let db; function openDB() { const DBOpenRequest = window.indexedDB.open("toDoList"); DBOpenRequest.onsuccess = (e) => { db = DBOpenRequest.result; }; }
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 | 1610 | 10 | 15 | 8 | 4.4 | 25 | 22 | 14 | 8 | 1.5 |
worker_support |
24 | 12 | 37 | 10 | 15 | 10 | 4.4 | 25 | 37 | 14 | 10 | 1.5 |
IDBDatabase
IDBTransaction
IDBKeyRange
IDBObjectStore
IDBCursor
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/indexedDB