我不知道为什么对控制器的调用会引起错误ajax jquery函数。成功执行控制器功能并返回"确定"。错误函数的" e"参数未定义。
我有这个代码
控制器代码-SpringMVC
@RequestMapping(value = "/updateItem/", method = RequestMethod.POST)
public String updateItem(Model model, HttpServletRequest request,
@RequestParam("id") String id, ...) {
//Operations
return "OK";
}
jQuery代码
function updateItem() {
$.ajax({
url : "/.../updateItem/",
type : 'POST',
async : false,
data : {
id : id.value,
...
},
success: function(response) { alert("second success"); },
error: function(e) { alert("error " + e);},
complete: function() { alert("complete"); },
});
}
}
打开铬
您在两个选项卡中遇到的帖子中有什么错误?
您的代码看起来还不错。