【发布时间】:2012-11-09 16:13:31
【问题描述】:
给定一个 indexeddb 数据库,其中一个声明的对象存储为:
var objectStore = thisDb.createObjectStore("table", {keyPath: "id", autoIncrement: true})
当我使用添加请求添加新项目时:
var resp = objectStore.add(row)
如何在onsuccess函数中获取这个添加项的新id?
resp.onsuccess = function(e) { /* code to get the id of the added item */}
【问题讨论】:
标签: indexeddb