$.mobile.showPageLoadingMsg() is not working

爷,独闯天下 提交于 2019-12-25 01:55:58

问题


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);  
     });

回答1:


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.



来源:https://stackoverflow.com/questions/16772919/mobile-showpageloadingmsg-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!