Hi, i currently use the client side database on an html5 iphone webapp. In my code i need to check if a row is present in the local DB :
function isStarted(oDB) {
var ret = null;
oDB.query(sql,params,function(transaction,result) {
if(result.rows.length > 0 ) {
ret = true;
} else {
ret = false;
}
});
return ret;
}
Unfortunately the return of isStarted() occurs before the callback function and i always get a "null" value. In the W3c spec we can see an "synchronous-database-api" but how can i use it ? Is there a trick to get the good "ret" value with asynchronus requets ?
Thanks for your help