--- title: WindowOrWorkerGlobalScope.indexedDB slug: Web/API/indexedDB tags: - API - Database - IndexedDB - Reference - Storage - WindowOrWorkerGlobalScope - 参考 - 属性 translation_of: Web/API/WindowOrWorkerGlobalScope/indexedDB original_slug: Web/API/WindowOrWorkerGlobalScope/indexedDB ---
{{ APIRef() }}
indexedDB
是 {{domxref("WindowOrWorkerGlobalScope")}}的一个只读属性,它集成了为应用程序提供异步访问索引数据库的功能的机制。.
var IDBFactory = self.indexedDB;
一个 {{domxref("IDBFactory")}} 对象.
示例
var db; function openDB() { var DBOpenRequest = window.indexedDB.open('toDoList'); DBOpenRequest.onsuccess = function(e) { db = DBOpenRequest.result; } }
Specification | Status | Comment |
---|---|---|
{{SpecName('IndexedDB 2', '#dom-windoworworkerglobalscope-indexeddb', 'indexedDB')}} | {{Spec2('IndexedDB 2')}} | Defined in a WindowOrWorkerGlobalScope partial in the newest spec. |
{{SpecName('IndexedDB', '#widl-IDBEnvironment-indexedDB', 'indexedDB')}} | {{Spec2('IndexedDB')}} | Initial definition. |