为什么我的 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函数吗?
最佳答案
在这种情况下,我遇到这个问题是由于 apache Web 服务器配置造成的。
服务器配置为接受 x mb 的数据,而我的有效负载超过 x。
检查访问日志是否发生这种情况。
在本例中,Firebug 在 POST 请求上显示“已中止”,而 chrome 开发工具显示“待处理”。
关于jquery - 为什么我的 jquery.ajax() 函数在上传到实时服务器时显示 'Aborted',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6412660/