indexedDB
只读特性在
WindowOrWorkerGlobalScope
mixin provides a mechanism for applications to asynchronously access the capabilities of indexed databases.
var IDBFactory = self.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;
}
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
索引数据库 API 草案
The definition of 'indexedDB' in that specification. |
推荐 |
Defined in a
WindowOrWorkerGlobalScope
partial in the newest spec.
|
|
索引数据库 API 2.0
The definition of 'indexedDB' in that specification. |
推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
indexedDB
|
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 2.0 |
| 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