WindowOrWorkerGlobalScope.indexedDB - Web API 接口参考 编辑
indexedDB
是 WindowOrWorkerGlobalScope
的一个只读属性,它集成了为应用程序提供异步访问索引数据库的功能的机制。.
语法
var IDBFactory = self.indexedDB;
值
一个 IDBFactory
对象.
示例
var db;
function openDB() {
var DBOpenRequest = window.indexedDB.open('toDoList');
DBOpenRequest.onsuccess = function(e) {
db = DBOpenRequest.result;
}
}
规范
Specification | Status | Comment |
---|---|---|
Indexed Database API Draft indexedDB | Recommendation | Defined in a WindowOrWorkerGlobalScope partial in the newest spec. |
Indexed Database API 2.0 indexedDB | Recommendation | Initial definition. |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 23webkit 24 | (Yes) | 10 moz 16.0 (16.0) 52.0 (52.0)[1] | 10, partial | 15 | 7.1 |
Available in workers | (Yes) | (Yes) | 37.0 (37.0) | ? | (Yes) | ? |
Indexed Database 2.0 | 58 | ? | ? | ? | 45 | ? |
Feature | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|---|
Basic support | (Yes) | ? | (Yes) | 22.0 (22.0) 52.0 (52.0)[1] | 1.0.1 | 10 | 22 | 8 |
Available in workers | (Yes) | ? | (Yes) | 37.0 (37.0) | (Yes) | ? | (Yes) | ? |
Indexed Database 2.0 | 58 | 58 | ? | ? | ? | ? | 45 | ? |
[1] indexedDB
定义在 WindowOrWorkerGlobalScope
mixin(一种实现多继承的方法)上.
相关链接
- Using IndexedDB
- Starting transactions:
IDBDatabase
- Using transactions:
IDBTransaction
- Setting a range of keys:
IDBKeyRange
- Retrieving and making changes to your data:
IDBObjectStore
- Using cursors:
IDBCursor
- Reference example: To-do Notifications (view example live.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论