deleteDatabase
Summary
Deletes a database with the specified name.
Method of apis/indexeddb/IDBFactoryapis/indexeddb/IDBFactory
Syntax
var dbOpenRequest = window.indexeddb.deleteDatabase(name);
Parameters
name
- Data-type
- String
The name of the database to delete.
Return Value
Returns an object of type DOM NodeDOM Node
An IDBOpenRequest request object that fires events to indicate the result of the request.
Examples
Delete a database
var dbDeleteRequest = window.indexedDB.deleteDatabase("BookShop1");
dbDeleteRequest.onsuccess = function(e){
write("Database successfully deleted");
};
dbDeleteRequest.onerror = function(e){
write("Error deleting DB");
};
dbDeleteRequest.onblocked = function(e){
write("Deleting DB Blocked");
};
Related specifications
- W3C IndexedDB Specification
- W3C Proposed Recommendation
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]