下面是我想在 div 中显示结果的内部数据库表的代码
var sear=$("#search").val();
var db = openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
db.transaction(function (tx) {
tx.executeSql("SELECT * FROM DEMO", [],
function (tx, results) {
var len = results.rows.length, i;
for (i = 0; i < len; i++) {
$('#output2').append('<tr>td>'+ results.rows.item(i).D_Indications +'</td></tr>');
alert(results.rows.item(i).D_Indications);
}
});
});
我可以在警报中查看结果,但无法在 div 中查看