这是我的代码 -
var selectAllStatement = "SELECT * FROM tasks";
function showRecords() // Function For Retrive data from Database Display records as list
{
$("#results").html('')
db.transaction(function (tx) {
tx.executeSql(selectAllStatement, [], function (tx, result) {
dataset = result.rows;
for (var i = 0, item = null; i < dataset.length; i++) {
item = dataset.item(i);
var linked= '<li>' + item['sno'] + '</li>' + '<li>' + item['taskdesc'] + '</li>';
$("#results").append(linked);
}
});
});
}
showRecords();
$('li').on('click', function () {
alert('Selected Value=' + $(this).text());
});
数据来自数据库,当我检查时,它为我提供了
这里有什么问题?