The indexedDB
property of the IDBEnvironment
interface provides a mechanism for applications to asynchronously access the capabilities of indexed databases.
Note: This feature is available in Web Workers.
SyntaxEdit
var DBOpenRequest = self.indexedDB.open("toDoList");
Value
An IDBFactory
object.
ExampleEdit
var db;
function openDB() {
var DBOpenRequest = window.indexedDB.open("toDoList");
DBOpenRequest.onsuccess = function(e) {
db = DBOpenRequest.result;
}
}
SpecificationsEdit
Specification | Status | Comment |
---|---|---|
Indexed Database API The definition of 'indexedDB' in that specification. |
Candidate Recommendation |
Browser compatibilityEdit
See alsoEdit
- 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.)