Reputation: 584
I am new to the jquery mobile while making ajax request i use to display the loading message until getting the response from sever. I tried a lot for this but no use.can any one help me out from this issue thanks in advance..
bellow ajax call code
$.ajax({
url: "url",
type: "GET",
contentType: "application/json; charset=utf-8",
beforeSend: function(){
setTimeout(function(){
$.mobile.loading('show');},1);
},
success: function(msg) {
// $.mobile.loading('hide');
$.each(msg.empWall, function() {
alert(this.name);
});
},
error: function(err) {
alert(err.toString());
},
complete: function(){
setTimeout(function(){
$.mobile.loading('hide');
},1);
});
Upvotes: 0
Views: 2325
Reputation: 57309
Web-kit browser have a problem with programatical execution of jQuery Mobile loader, but it can be executed like this:
Show:
setTimeout(function(){
$.mobile.loading('show');
},1);
Hide:
setTimeout(function(){
$.mobile.loading('hide');
},1);
They just need a small delay caused by setTimeout
or setInterval
function.
Upvotes: 5