框架用的SpringMVC,使用FormData对象,采用ajax提交表单到controller.顺遂提交到背景,背景功能顺遂执行,但是返回时总是调用error。求救!!!!!!!!以下是ajax部门代码function releaseCourseware(){ var form = new FormData(document.getElementById("releasecoursewareformid")); $("#myModal").hide(); $.ajax({ url:"${pageContext.request.contextPath }/course/insertOneCourse.do", type:"post", data:form, dataType:"text", processData:false, contentType:false, success:function(data){ alert("发布乐成!"); $("#justforquery").attr("action","${pageContext.request.contextPath}/course/courseResourceList.do"); $("#justforquery").submit(); },error:function(e){ alert("发布失败!!"); $("#justforquery").attr("action","${pageContext.request.contextPath}/course/courseResourceList.do"); $("#justforquery").submit(); } }); } |