2
Hello, good day.
I am with my app here on the following question.
have the page index.html,
on this page I have a <div>
so that the loading according to the code below:
<div id="loader" style="display: none;"> <img src="loading.gif" align="center" width="200" height="180">Carregando...</div>
Now I have the js file.
function onCarregaFunVeiEqu () {
$.ajax({
url: ''''''''getFun.php'''''''',
type: ''''''''get'''''''',
async: false,
beforeSend: function(){
$("#loader").show();
$("#loader").css({display:"block"});
},
success: function(response){
var obj = JSON.parse(response);
obj.forEach(function (o, index) {
onSincFun(o.cdfun, o.nmfun, o.nusen, o.nmatri);
});
$.ajax({
url: ''''''''getVei.php'''''''',
type: ''''''''get'''''''',
async: false,
success: function(response){
var obj = JSON.parse(response);
obj.forEach(function (o, index) {
onSincVei(o.cdve, o.nuplaca, o.detip, o.demdl);
});
$.ajax({
url: ''''''''getEquipe.php'''''''',
type: ''''''''get'''''''',
async: false,
success: function(response){
DeleteEqu();
var obj = JSON.parse(response);
obj.forEach(function (o, index) {
onSincEqu(o.cdequ, o.deequ, o.dearea, o.nmobra);
});
}
});
}
});
},
complete: function(data){
//$("#loader").hide();
}
}).always (function() {
$("#loader").show();
$("#loader").css({display:"block"});
}).done (function() {
$("#loader").hide();
$("#loader").css({display:"none"});
});
}
what happens is :
the Loading.. it looks, but already gone... And in the meantime, he’s synchronizing.. that is to say he had to synchronize EVERYTHING and then disappear Loading...
someone has a suggestion?
how can I make "Loading" visible until the end ? I’ve done it separately... Had created 3 Function.. with Sync = False; also didn’t work out. Then I did 3 Function with Sync = True; , too. plus what I know is not very good to let Sync = false. as it can "freeze" the user screen.
– MS Sistemas
looks like it worked! Thanks, missed rsrs... I was banging my head for 3 days... already taking advantage of the hook. has something here forum or example... I don’t know the name, of getting the entire screen "locked/ blurred" and loading loading ...
– MS Sistemas