![](/img/trans.png)
[英]IndexedDB when populating many ObjectStores, Error: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running
[英]indexedDB Creating a database and adding content Failed to execute 'transaction' on 'IDBDatabase'
這是我第一次使用indexDB,我創建了一個數據庫,現在嘗試向其中添加內容。 但我收到以下錯誤。
未發現NotFoundError:無法在“ IDBDatabase”上執行“事務”:找不到指定的對象存儲之一。
我將代碼上傳到jsfiddle只是因為它更容易向您展示其運行情況。 有什么建議嗎?
https://jsfiddle.net/8kj43kyn/
// Creating an indexDB - Used to store users information.
window.indexedDB = window.indexedDB || window.mozIndexedDB ||
window.webkitIndexedDB || window.msIndexedDB;
那應該
var transaction = db.transaction( ["books", 'readwrite']);
是
var transaction = db.transaction(["books"], 'readwrite');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.