最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - indexedDB Creating a database and adding content Failed to execute 'transaction' on 'IDBDat

programmeradmin2浏览0评论

This is the first time for me to use indexDB, I've created a database and now trying to add content to it. But I'm getting the following error.

Uncaught NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.

I've uploaded my code on jsfiddle just because its easier to show you it running. Any suggestions please ?

/

// Creating an indexDB - Used to store users information.  
window.indexedDB = window.indexedDB || window.mozIndexedDB || 
window.webkitIndexedDB || window.msIndexedDB;

This is the first time for me to use indexDB, I've created a database and now trying to add content to it. But I'm getting the following error.

Uncaught NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.

I've uploaded my code on jsfiddle just because its easier to show you it running. Any suggestions please ?

https://jsfiddle.net/8kj43kyn/

// Creating an indexDB - Used to store users information.  
window.indexedDB = window.indexedDB || window.mozIndexedDB || 
window.webkitIndexedDB || window.msIndexedDB;
Share Improve this question edited May 25, 2018 at 6:47 Saeed 5,4883 gold badges29 silver badges41 bronze badges asked Apr 30, 2016 at 13:21 RyanRyan 2712 gold badges3 silver badges7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 16

Should that

var transaction = db.transaction( ["books", 'readwrite']);

be

var transaction = db.transaction(["books"], 'readwrite');

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论