Notice:
The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.

IDBFactory

< apis‎ | indexeddb
Jump to: navigation, search

IDBFactory

This article is Ready to Use.

W3C Proposed Recommendation

Summary

The object type for the indexedDB property, which provides access to the IndexedDB features supported by the browser and/or device.


Properties

No properties.

Methods

API Name Summary
cmp This method compares two specified keys. Returns 1 if the first key is greater than the second, -1 if the first is less than the second, and 0 if the first is equal to the second.
deleteDatabase Deletes a database with the specified name.
open The open method is used to open an IndexedDB database.


Events

No events.

Examples

The following example uses feature detection to determine whether IndexedDB is supported by the current browser/device.

JavaScript

function getIndexedDBHandle() {
   var oResult = null; 
   if ( window.indexedDB ) {
      oResult = window.indexedDB;
   } else if ( window.mozIndexedDB ) { 
      oResult = window.mozIndexedDB;
   } else if ( window.webkitIndexedDB ) {
      oResult = window.webkitIndexedDB;
   }
   return oResult;
}

var ixHandle = getIndexedDBHandle();
if ( getIndexHandle == null ) {
   doFallback();
} else {
   doIndexedDBWork(};
}

Notes

Remarks

Use the indexedDB property to access IndexedDB databases.

Important  For security reasons, Internet Explorer support for the indexedDB property is limited to webpages loaded using the "http://" or "https://" protocols.


Related specifications

Specification Status Related Changes
W3C IndexedDB Specification W3C Proposed Recommendation

See also

External resources

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]

}





}