2

为什么我的jQuery.ajax()功能在我的本地服务器上运行良好,但上传时我现在在 Firebug 中得到“中止”响应?

在此处输入图像描述

ajax 函数调用同一个域,看起来像这样

jQuery.ajax({
  url: homeUrl+'/engine/check/',
  data: jQuery('#post').serialize(),
  type: 'post',
  beforeSend:function(){
    jQuery('#checker span').text('checking status...').parent().show();
  },
  success: function(data){
    if(data == 'not_gallery'){
      jQuery('#checker').hide();
    }

    if(data == 'no_folder'){
      jQuery('#loader').hide();
      jQuery('#checker span').html('please ensure you have chosen a folder to connect to this gallery');
    }

    if(data == 'complete'){
      jQuery('#loader').hide();
      jQuery('#checker span').html('Gallery Active');
    }

    if(data == 'in_crunch'){
      jQuery('#loader').show();
      jQuery('#checker span').html('Crunching in progress. This may take a while...');
      refreshIntervalId = setInterval( 'check_poll()', 15000 );
    }

    if(data == 'init_crunch'){
      jQuery('#loader').show();
      jQuery('#checker span').html('Crunching in progress. This may take a while...');
      jQuery.post(homeUrl+'/engine/crunch/', jQuery('#post').serialize(), function(data){
        if(data == 'done'){
          jQuery('#loader').hide();
          jQuery('#checker span').html('Gallery Active');
        }                                                                                     
      });
    }
  }
});

会不会是我的嵌套 ajax 函数?

4

1 回答 1

0

在这种情况下,我遇到此问题是由于 apache Web 服务器配置。

服务器配置为接受 x mb 的数据,而我的有效负载超过 x。

如果发生这种情况,请检查访问日志。

在这种情况下,对于我来说,萤火虫显示“已中止”,而 chrome 开发人员工具在 POST 请求上显示“待处理”。

于 2013-11-25T03:37:38.417 回答