ajax为什么不执行success直接跳到error呢
$.ajax({type:'post',url:'pingTai/operatorPingTaiAction!toUpdateOperator.action?operat...
$.ajax({
type : 'post',
url : 'pingTai/operatorPingTaiAction!toUpdateOperator.action?operator.ids='+value,
dataType : 'json',
success : function(data){
alert("dsa");
$.each(data,function(i, user) {
alert("dsa");
$("#OperatorName").val(user.names);
});
},
error: function(){
}
});
后台:
public String toUpdateOperator() throws Exception {
if (null != operator && 0l != operator.getIds()) {
operator = operatorServiceImpl.getOneOperator(operator.getIds());
}
returnPageURL = "/WEB-INF/jsp/pingtai/operator/operatorUpdate.jsp";
request.setAttribute("bean", operator);
response.getWriter().print(operator);
JSONObject obj = new JSONObject().fromObject(operator);
response.getWriter().print(obj);
return null;
} 展开
type : 'post',
url : 'pingTai/operatorPingTaiAction!toUpdateOperator.action?operator.ids='+value,
dataType : 'json',
success : function(data){
alert("dsa");
$.each(data,function(i, user) {
alert("dsa");
$("#OperatorName").val(user.names);
});
},
error: function(){
}
});
后台:
public String toUpdateOperator() throws Exception {
if (null != operator && 0l != operator.getIds()) {
operator = operatorServiceImpl.getOneOperator(operator.getIds());
}
returnPageURL = "/WEB-INF/jsp/pingtai/operator/operatorUpdate.jsp";
request.setAttribute("bean", operator);
response.getWriter().print(operator);
JSONObject obj = new JSONObject().fromObject(operator);
response.getWriter().print(obj);
return null;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询