Created
May 11, 2018 07:03
-
-
Save goofmint/a0d05952049608da69032e84bd7fbfee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const transaction = db.transaction(["items"], "readwrite"); | |
transaction.oncomplete = function(event) { | |
console.log("完了しました"); | |
}; | |
transaction.onerror = function(event) { | |
console.log("エラーです", event); | |
}; | |
const objItem = transaction.objectStore("items"); | |
for (let i = 1; i < 10; i += 1) { | |
objItem.add( | |
{id: i, name: `テスト商品 ${i}`, description: `テスト商品 ${i} の説明`, add: '追加'} | |
).onsuccess = function (event) { | |
console.log(event.target.result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment