我想输入名字查询数据库中的值,点击查询按钮就跳出显示查询的值。
查询的代码如下:
function findData(){//删除所有数据
var person = document.getElementById('name').value;
db.transaction(function(tx){
tx.executeSql('select tel from TelData where name=?',[person],function(tx,res){
alert(res);//如何修改
},function (tx,err){
alert('无法查找'+err.message);
})
})
showAllData();
}
感谢大家的指点。
现在是出现了什么问题吗,可以先排查请求数据库是否成功呢