Ext.ajax返回码为0,请给予帮助

xuyang198711 2012-07-22 10:06:33
在使用ext的ajax进行交互时,执行下面代码后进入后台action中,查看日志action正常执行,也正常返回,那为什么在页面的ajax中接受的是failure信息,其中response.status为0,response.responseText为undifine?请大牛们帮忙分析一下。
(后台action中打了日志,查看日志一切执行正常)


Ext.Ajax.request(
{
url : batchUrl,
method : 'post',
timeout : timeout,
params :
{
deleteIds : deleteIds,
deleteNames : deleteNames
},
success : function(response, options)
{
var info = response.responseText;
alert(info);
},
failure : function(response, options) // 删除出现异常的情况,提示删除失败
{
var respText = Ext.util.JSON.decode(resp.responseText);
//偶现的response.status为0,response.responseText为undifine,请问为什么会失败?
alert("failure-->" + response.status + "==" + response.responseText + "==" + respText.error);
}
});


...全文
140 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
langreatperson 2013-11-05
  • 打赏
  • 举报
回复
请大神帮帮忙
langreatperson 2013-11-05
  • 打赏
  • 举报
回复
我的也出现这样的情况, java后台没有问题 始终执行那个failure方法,打印response.readyState=undefined ;response.responseText=undefined ;response.responseXML=undefined ;response.status=0;response.statusText=communication failure
Go 旅城通票 2012-07-30
  • 打赏
  • 举报
回复
var respText = Ext.util.JSON.decode(resp.responseText);


应该是超时了。你客户端设置超时5分钟没用的,确保你服务器的配置也允许脚本执行5分钟,要不服务器端脚本超时也会执行failure回调
xuyang198711 2012-07-30
  • 打赏
  • 举报
回复
没人帮助吗?!!!
xuyang198711 2012-07-22
  • 打赏
  • 举报
回复
补充,这个是批量删除的功能,大量删会花费1分钟左右,超时时间爱你我设置的是5分钟,出错的情况极少见,可是还是存在这个情况的,请帮忙分析原因啊。。。

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧