Baseline Widely available
Note: This feature is available in Web Workers.
The request
read-only property of the IDBCursor
interface returns the IDBRequest
used to obtain the cursor.
An IDBRequest
object instance.
When you open a cursor, the request
property is then available on that cursor object, to tell you what request object the cursor originated from. For example:
function displayData() {
list.textContent = "";
const transaction = db.transaction(["rushAlbumList"], "readonly");
const objectStore = transaction.objectStore("rushAlbumList");
const request = objectStore.openCursor();
request.onsuccess = (event) => {
const cursor = event.target.result;
if (cursor) {
const listItem = document.createElement("li");
listItem.textContent = `${cursor.value.albumTitle}, ${cursor.value.year}`;
list.appendChild(listItem);
console.log(cursor.request);
cursor.continue();
} else {
console.log("Entries all displayed.");
}
};
}
Specifications Browser compatibility See also
IDBDatabase
IDBTransaction
IDBKeyRange
IDBObjectStore
IDBCursor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4