EXTJS,表单提交完总是调用failure??? 返回的 json 数据应该包括制定到 succes 或者是 failure 中 // 返回的格式必须是 json 数据的格式。 response.getWriter().println("{success:true,msg:'ok'}"); 在后台返回的 json 数据中添加 success:true 的说明。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 服务器端代码:....try { response.getWriter().write("{success:'true'}");//如果为false则前台调用 failure 函数,默认为false; } catch (IOException e) { e.printStackTrace(); }....前台代码:success:function(response, options) { var response = Ext.util.JSON.decode(response.responseText); if(response.success=='true'){ Ext.Msg.alert("提示信息",'存储成功'); store.reload(); grid.reconfigure(store,cm); winAdd.close(); }else{ Ext.Msg.alert("提示信息",'存储失败!'); } //winAdd.close(); }, failure:function(){ Ext.Msg.alert('提示信息',' 操作失败! '); } jquery代码不执行 新手求助 如何知道那个脚本修改了网页? XMLHttpRequest 中的responseText 返回值问题 问个实在的问题,通过鼠标事件或者其他办法,完成保存好2个节点 jol_boy 进来看下~~ 我想实现图片转换滤镜功能~~求教各位朋友 如何判断文本框里的内容是否全为数字? 小女子向各位大哥请教:如何让页面中的按钮控件随页面水平滚动条的拖动而永远居中? ★★十万火急的问题 请问怎样返回目标文档 谁给我写个简单点的js注册新用户的例子啊??高分啊
try {
response.getWriter().write("{success:'true'}");//如果为false则前台调用 failure 函数,默认为false;
} catch (IOException e) {
e.printStackTrace();
}
....前台代码:success:function(response, options) {
var response = Ext.util.JSON.decode(response.responseText);
if(response.success=='true'){
Ext.Msg.alert("提示信息",'存储成功');
store.reload();
grid.reconfigure(store,cm);
winAdd.close();
}else{
Ext.Msg.alert("提示信息",'存储失败!');
}
//winAdd.close();
},
failure:function(){
Ext.Msg.alert('提示信息',' 操作失败! ');
}