var db2arr = function() {
var text = string.Empty;
$(".tab_savedata .tmptextbox").empty();
(dexie db class).tables.forEach( //access all tables
function(table) {
table.toArray(function(all) { //add table data tmptext
//$(".tab_savedata .tmptextbox").append(
text += (
"\"" + table.name + "\":" +
JSON.stringify(all) +
","
);
});
}
);
return text.substring(0, -1);
}
$(".tab_savedata .export_data").on("click", function() {
alert(db2arr());
}
When I execute this code, the "text" var stays empty. I had tried with commented part, but the element was not updated until the all function is finished.
This is the part of the chrome plugin, and supposed to print whole db in "dexie db class" class in json format.
I am sure that there is no other var named text. And I was running this at chrome.
https://github.com/Yukinyaa/KC3Kai/tree/master/src here is the whole project.