过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
重要
:
indexedDB
property that was previously defined in this mixin is instead now
WindowOrWorkerGlobalScope.indexedDB
(that is, defined as a member of the
WindowOrWorkerGlobalScope
mixin).
IDBEnvironment
helper of the
IndexedDB API
包含
indexedDB
property, which provides access to IndexedDB functionality. It is the top level IndexedDB interface implemented by the
window
and
Worker
对象。
IDBEnvironment.indexedDB
只读
IDBFactory
对象。
The following code creates a request for a database to be opened asychronously, after which the database is opened when the request's
onsuccess
handler is fired:
var db;
function openDB() {
var DBOpenRequest = window.indexedDB.open("toDoList");
DBOpenRequest.onsuccess = function(e) {
db = DBOpenRequest.result;
};
}
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
IDBEnvironment
弃用
非标
|
Chrome
24
|
Edge 12 |
Firefox
16
|
IE 部分支持 10 | Opera 15 | Safari 7 | WebView Android Yes | Chrome Android 25 | Firefox Android 22 | Opera Android 14 | Safari iOS 8 | Samsung Internet Android 1.5 |
| Available in workers 弃用 非标 | Chrome Yes | Edge ≤18 | Firefox 37 | IE ? | Opera Yes | Safari ? | WebView Android Yes | Chrome Android Yes | Firefox Android 37 | Opera Android Yes | Safari iOS ? | Samsung Internet Android Yes |
完整支持
部分支持
兼容性未知
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
要求使用供应商前缀或不同名称。
IDBDatabase
IDBTransaction
IDBKeyRange
IDBObjectStore
IDBCursor