【问题标题】:jquery ajaxStop event not working in IE9jquery ajaxStop 事件在 IE9 中不起作用
【发布时间】:2013-01-26 20:26:38
【问题描述】:

我们试图在多个异步 ajax 调用完成后隐藏加载器图标。因此我们需要使用 ajaxStop 事件。但是这个事件在 ie9(windows 手机)中没有被触发。但是,ajaxStart 有效。我们只在 Windows 手机的 ie9 中遇到这个问题。它适用于桌面版本的 IE9 和 IE8。我们使用的是 jquery 1.7 版。

下面是代码sn -p -

$(document).ajaxStop( function(){
    $('#loader').hide();
});

我们还缺少什么吗?

【问题讨论】:

  • 我猜代码应该是 $.ajaxStop(function(){ ... });
  • @KundanSinghChouhan,我认为从 jQuery 1.8 开始,ajaxStop 应该只像 $(document).ajaxStop(function(){}) 这样附加到文档中

标签: jquery ajax internet-explorer-9


【解决方案1】:

检查this,但您的approach 也在IE 9 中工作。

//displays progress bar
$('.progress').ajaxStart(function () {
    $(this).show();
}).ajaxStop(function () {
    $(this).hide();
});

【讨论】:

    【解决方案2】:

    您必须在 IE 上设置 async:true..bocz 无法处理异步调用。

    检查下面的代码..这里你必须设置“async:true”......所以,你的代码应该在下面。

    var selectRows = $('#rowed3').getGridParam('selarrrow');
    $.each(selectRows,function (index,id) {
      $.ajax({                            
              url:'addSign',
              success: function (result) {                                                 
            $("#progressbar").progressbar('option','value',currPercent);
             },
              async:true,
              data:{
              'id':id,
              'details':sign
                   },
           type:'post'
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多