I wanted to separate my main.js file from my sqlite function file. How can I get the result of the query to the main.js (fr anotherFile.js).
//In main.js
function getResult() {
queryDB(); //how to get d result from queryDB() ?
}
// In anotherFile.js:
function queryDB(tx) {
tx.executeSql('SELECT * FROM DEMO', [], onSuccess, onError);
}
function onSuccess(tx, results) {
for (var i=0; i<result.length; i++) {
//what to put here, Array?
}
}
thanks.