Your Search Results

    IDBEnvironment Redirect 1

    « IDBEnvironment

    The IDBEvironment interface of the IndexedDB API provides asynchronous access to a client-side database. It is implemented by window and Worker objects.

    Properties

    IDBEnvironment.indexedDB Read only
    Provides a mechanism for applications to asynchronously access capabilities of indexed databases.

    Example

    The following code opens a database asynchronously and makes a request.

    var db;
    function openDB() {
     var request = indexedDB.open("toDoList");
     request.onsuccess = function(e) {
       db = request.result;
     }
    }
    

    Specifications

    Specification Status Comment
    Indexed Database API Candidate Recommendation  

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
    Basic support 12webkit
    23
    4.0 (2.0) 10 17 Not supported
    Feature Android Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
    Basic support 4.4 6.0 (6.0) 1.0.1 10 17 Not supported

    Be careful in Chrome as it still implements the old specification along the new one. Similarly it still has the prefixed webkitIndexedDB property even if the unprefixed indexedDB is present.

    See also

    To learn more about various topics, see the following

    • Starting transactions: IDBDatabase
    • Setting transaction modes: IDBTransaction
    • Setting a range of keys: IDBKeyRange
    • Creating cursors: IDBIndex
    • The reference application for the examples in this reference: To-do Notifications (view example live.) Not every snippet appears in this example, but every example uses the same data structure and syntax, and will make sense in the context of this application.

    Document Tags and Contributors

    Contributors to this page: teoli
    Last updated by: teoli,