This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

IDBFactory

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

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.

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

W3C IndexedDB Specification
W3C Proposed Recommendation

See also

External resources

}

}

Attributions