indexedDB

Jump to: navigation, search

indexedDB

This page has been flagged with the following issues:



Summary

Provides access to the IndexedDB features supported by the browser and/or device.

Property of dom/window

Syntax

var ixDBHandle = window.indexedDB;
window.indexedDB = value;

Return Value

Returns an object of type IDBFactory.

A handle to the IndexedDB "factory," which allows access to IndexedDB features on the current browser/device.

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

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

Note  In pre-release versions of Internet Explorer 10, the indexedDB was accessed using a vendor prefix (msIndexedDB). Such use is considered obsolete; applications using the vendor prefix should be updated to ensure standards-compliance and future compatibility.


Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support 24
22 -webkit
16
15 -moz
10
?
Unsupported

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic Support Unsupported
?
10 -webkit
?
?
6.0 -moz
10
?
Unsupported
Unsupported

See also

Related pages (MSDN)

This article contains content originally from external sources.

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