我能';t read db.transaction(WEBsql、javascript、jquery)
在我的我能';t read db.transaction(WEBsql、javascript、jquery),javascript,jquery,web-sql,Javascript,Jquery,Web Sql,在我的 $(文档).ready(函数(){…} 我有我的纽扣 $('#saveDate')。单击(函数(){ insertDateOfProcedure(); showRecords(); }); 它有两个功能,第一个是 function insertRecordPaziente() { var nome=$('#id').val(); var bday=$('#bday').val(); var clinicalNotes=$('#clinical
$(文档).ready(函数(){…}
我有我的纽扣
$('#saveDate')。单击(函数(){
insertDateOfProcedure();
showRecords();
});
它有两个功能,第一个是
function insertRecordPaziente()
{
var nome=$('#id').val();
var bday=$('#bday').val();
var clinicalNotes=$('#clinicalNotes').val();
var fkPaziente=null;
db.transaction(function (tx) {
tx.executeSql('INSERT INTO paziente (nomePaziente, bDay, sex, clinicalNotes ) VALUES (?, ?, ?, ?)' , [nome, bday, radioButtonSex(), clinicalNotes] );
});
}
二是
function saveFK(){
db.transaction(function (tx) {
alert("??");
tx.executeSql("select seq from sqlite_sequence where name='paziente';", [], function (tx, result)
{
alert("12334");
dataset = result.rows;
if(dataset.length > 0)
{
for (var i = 0, item = null; i < dataset.length; i++)
{
alert("ciao Mondo b");
item = dataset.item(i);
console.log(item['seq']);
fkPaziente=item['seq'];
alert("fkPaziente: "+fkPaziente);
return fkPaziente;
}
} else {alert("problemi con transiction");}
});
});
}
你能帮我吗
var db=openDatabase("hospital2", "1.0", "hospitalDatabase", 200000);