Looking for help with updating information in a websql database using a function. Currently, I'm facing an issue where the loading box closes before the get function completes its task, leading to incomplete updates.
I need a solution where the next iteration of the loop only occurs once the get function has finished executing.
If anyone has a workaround for this, please share your thoughts! :(
The technology stack I'm working with includes appframework intel (jqmobi).
for (var i=0; i<len; i++){
var url = "http://172.25.129.30:8180/prax/rest/ocorrenciaJSONBean/consultarStatusOcorrencia/"+results.rows.item(i).id;
$.get(url,function(data){
tx.executeSql('UPDATE ocorrencias SET status="'+data.responseText+'" WHERE id = '+results.rows.item(i).id);
});
};
Here's the situation:
We have an internal database containing a list of user-opened calls. The goal is to update the status of these calls.
Currently, I fetch each call's status from a webservice based on their ID from the internal database. However, I want the next iteration to only proceed once the GET request has been completed.
The challenge lies in the fact that the loading message disappears too soon, before all the GET requests have been finalized.