Articles → HTML 5 → IDBOpenDBRequest interface of indexedDB

IDBOpenDBRequest interface of indexedDB






Purpose





Example


var db;

// Let us open our database
var DBOpenRequest = window.indexedDB.open("toDoList", 4);

// these two event handlers act on the database being
// opened successfully, or not
DBOpenRequest.onerror = function (event) {
            alert("Error loading database");
};

DBOpenRequest.onsuccess = function (event) {
            alert("Database initialized");

            // store the result of opening the database.
            db = DBOpenRequest.result;
};





Click to Enlarge


Output





Click to Enlarge




Posted By  -  Karan Gupta
 
Posted On  -  Saturday, September 08, 2018

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250