tx.executeSql("SELECT * FROM Routes WHERE id_object = 0", [],
function (tx, result)
{
alert('You already added');
},
function (tx, error) {
tx.executeSql('INSERT INTO Routes (id_object) VALUES (0)');
alert('add successfull')} )
}
如果结果集SELECT * FROM Routes WHERE id_object = 0
为空,则应执行tx.executeSql('INSERT INTO Routes (id_object) VALUES (0)');