我试过这段代码:
O(log(n))
但问题是它会产生第一行的值。如何找到suppose的值(rows = 2,column = 3) 请帮忙!
答案 0 :(得分:0)
function getAllProducts(){
var products = [];
var request;
var transaction = db.transaction(["product"], "readonly");
var objectStore = transaction.objectStore("product");
transaction.oncomplete = function(event) {
console.log(products);
console.log(event);
};
transaction.onerror = function(event) {
console.error(event);
};
transaction.onabort = function(event) {
console.log("YO YO YO");
console.error("transaction aborted");
};
request = objectStore.openCursor();
request.onsuccess = function(event) {
var cursor = event.target.result;
if(cursor) {
products.push(cursor.value.name);
cursor.continue();
}
};
request.onerror = function(event) {
console.error(event.error);
};
}