Open Humphrey-Huang opened 11 years ago
Seems when this function is invoked, the db.version has been changed. So, I try to change codes as followed, please check:
request.onupgradeneeded = function(e) { todoDB.indexedDB.db = e.target.result; var db = todoDB.indexedDB.db; console.log ("Going to upgrade our DB from version: "+ e.oldVersion + " to " + e.newVersion); if(db.objectStoreNames.contains("todo")) { db.deleteObjectStore("todo"); } var store = db.createObjectStore("todo", {keyPath: "timeStamp"}); console.log("-- onupgradeneeded store:"+ JSON.stringify(store)); };
Could you please have a look at the changes that I've made to the code? I guess it was the objectStoreNames that coz it. Thanks!
closing... ✔️
Seems when this function is invoked, the db.version has been changed. So, I try to change codes as followed, please check: