Jquery ajax回调函数不执行

ajax如下:

$.post(
"${pageContext.request.contextPath}/deptHead_assign.action",
{"studentId":student.id,"subjectId":selectedRows[0].subjectId},
function(result){
alert(result.num);
$.messager.alert("系统提示","落选学生<font color=red>"+student.name+"</font>已指派题目!");
$("#dlg").dialog("close");

},"Json");

回调函数不执行的原因可能是:

执行返回json类型,后台传过来的不是json字符串,所以不执行.

后台传过来的参数一定要和指定返回的参数类型一致,不然就将json改为text类型

    

猜你喜欢

转载自www.cnblogs.com/goxcheer/p/9093762.html