小编Vin*_*kar的帖子

jQuery Mobile showPageLoadingMsg()/ hidePageLoadingMsg()方法仅适用于firefox浏览器

我试图$.mobile.showPageLoadingMsg()在用户点击登录按钮后使用jquery mobile .在这个操作之后我正在对webservice进行ajax调用,在得到响应之后我隐藏了加载消息.问题是加载器只在firefox浏览器中显示而不是在其他浏览器中显示(chrome,safari,android).

例:

$.mobile.showPageLoadingMsg();
var response = $.ajax(
 {
   type: "POST",
   url: "service.php",
   data: "...",
   async: false,
   dataType: "json",
   cache: false
   });
   response.success(function (data)
    {
    res_content = data;
    });
    response.error(function (jqXHR, textStatus, errorThrown)
    {
  }
 $.mobile.hidePageLoadingMsg();
Run Code Online (Sandbox Code Playgroud)

我还发现,如果我给hidePageLoadingMsg提供超时,那么加载器会显示出来.

setTimeout(function(){$.mobile.hidePageLoadingMsg()},5000);
Run Code Online (Sandbox Code Playgroud)

加载器需要更多时间才能显示出来,即它在ajax调用后显示并显示5秒.由于给出超时不是一个修复.请帮忙.

javascript jquery jquery-mobile

2
推荐指数
1
解决办法
9616
查看次数

标签 统计

javascript ×1

jquery ×1

jquery-mobile ×1