I have a function return an array data as below.
function get_info_tb(){
var transaction = db.transaction(["mydb"]);
var objectStore = transaction.objectStore("mydb");
var request = objectStore.get("01");
request.onerror = function(event) {
alert("Unable to retrieve daa from database!");
};
request.onsuccess = function(event) {
var data = request.result;
};
return data;
}
How to return varible data of request.onsuccess for get_info_tb?
I have a bit of a problem with the asynchronous of javascript. Please help me and thanks for everyone.!