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
You have to block the next execution when you intend to retrieve the results synchronously, The price you have to pay is the UI getting blocked during the execution.
var ret = null;
var finished = false;
cfunction isStarted(oDB) {
oDB.query(sql,params,function(transaction,result) {
ret = result;
finished = true;
});
while(!finished){
;//block next execution, while result is being fetched
}
return ret;
}