我用phonegap写了一个android应用程序。我想使用 indexedDB,但我总是遇到异常。NOT_FOUND_ERR:DOM IDBDatabase 异常 3:264
当我初始化 indexedDB 时,我没有收到错误:
//todo csinálni kell inicializált eventet
// In the following line, you should include the prefixes of implementations you want to test.
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
// DON'T use "var indexedDB = ..." if you're not in a function.
// Moreover, you may need references to some window.IDB* objects:
window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction;
window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;
// (Mozilla has never prefixed these objects, so we don't need window.mozIDB*)
if (!window.indexedDB) {
window.alert("Your browser doesn't support a stable version of IndexedDB. Such and such feature will not be available.");
}
当我记录 indexedDB 时,我得到[object IDBDatabase]
.
我在这一行得到错误:var trans = db.transaction([index], "readwrite");
我的代码可以在 PC 上的桌面浏览器上运行,但它不能在平板电脑上运行。我已经在我的 PC 上的 Chrome 和 Firefox 浏览器上进行了测试。
我该如何解决这个问题