This question is locked. New answers and comments are not allowed.
As summed by the title, my project with a sqlite db works perfectly with the Android and on the simulator. Data is successfully being spanned onto a table, however when it comes to the iphone, it does create the header but no data is selected at all for the table body. Code showed as below.
I did some research an people said it's mainly due to syntax error when executing the database, but I hardly find any typos? Appreciate any pointers!
app.refresh = function(){
var render = function (tx, rs){
//GENERATE TABLE WITH HEADER
var table = "<table id='page1table'><thead><th>AssetID</th></tr></thead><tbody>";
//THIS IS THE PART NOT WORKING, AND rs.rows.length IS ALWAYS ZERO
for (var i = 0; i < rs.rows.length; i++) {
var row = rs.rows.item(i);
table += "<tr><td>" + row.AssetID + "</td></tr>";
}
table += "</tbody></table>";
var todoItems = document.getElementById("content");
todoItems.innerHTML = table;
}
//Open DB
var db = app.db;
db.transaction(function(tx) {
tx.executeSql("SELECT AssetID FROM tblApp", [],
render,
app.onError);
});
}
I did some research an people said it's mainly due to syntax error when executing the database, but I hardly find any typos? Appreciate any pointers!
app.refresh = function(){
var render = function (tx, rs){
//GENERATE TABLE WITH HEADER
var table = "<table id='page1table'><thead><th>AssetID</th></tr></thead><tbody>";
//THIS IS THE PART NOT WORKING, AND rs.rows.length IS ALWAYS ZERO
for (var i = 0; i < rs.rows.length; i++) {
var row = rs.rows.item(i);
table += "<tr><td>" + row.AssetID + "</td></tr>";
}
table += "</tbody></table>";
var todoItems = document.getElementById("content");
todoItems.innerHTML = table;
}
//Open DB
var db = app.db;
db.transaction(function(tx) {
tx.executeSql("SELECT AssetID FROM tblApp", [],
render,
app.onError);
});
}