| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/API/IDBTransaction/objectStore | [Back] [Original] |
Get to know MDN better
objectStore(name)
NotFoundError DOMExceptionInvalidStateError DOMExceptionconst note = document.getElementById("notifications");
// IDB db
let db;
//
const DBOpenRequest = window.indexedDB.open("toDoList", 4);
DBOpenRequest.onsuccess = (event) => {
note.innerHTML += "<li></li>";
// db
//
db = DBOpenRequest.result;
// addData()
addData();
};
function addData() {
// IDB
const newItem = [
{
taskTitle: "Walk dog",
hours: 19,
minutes: 30,
day: 24,
month: "December",
year: 2013,
notified: "no",
},
];
//
const transaction = db.transaction(["toDoList"], "readwrite");
//
transaction.oncomplete = (event) => {
note.innerHTML +=
"<li>: </li>";
};
transaction.onerror = (event) => {
note.innerHTML +=
"<li></li>";
};
//
const objectStore = transaction.objectStore("toDoList");
// newItem
const objectStoreRequest = objectStore.add(newItem[0]);
objectStoreRequest.onsuccess = (event) => {
// (
// transaction.onsuccess )
note.innerHTML += "<li></li>";
};
}
| Indexed Database API 3.0 # ref-for-dom-idbtransaction-objectstore |
IDBTransaction| Web Proxy Viewer | New URL | Original Page |