原始ajax提交:
$.ajax({
type: "POST",data:"processId="+$("#processId").val()+"&delstepids="+delstepids,url: "./delStepForProcess.jspx",dataType: "text",cache: false,success: function(data){
if(1==data){
alert("删除失败!");
return;
}else{
location.reload();
}
}
});
data:"参数1="+参数值
ajax提交form:
$.ajax({
type: "POST",data:$("#theForm").serialize(),url: "${basePath}/public/sjkf/serveyanswer/saveData.jspx",success: function(data){
if(1==data){
alert("删除失败!");
}else{
}
}
});
data:$("#form的id").serialize()
action(或者controller)中接受参数:
request.getParameter("token");
返回信息:
PrintWriter out = null;
try {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/json;charset=UTF-8");
out =response.getWriter();
customProcessService.modifyStepToStart(processId,stepId);
out.println("0");
} catch (Exception e) {
out.println("1");
e.printStackTrace();
}finally{
if(out!=null){
out.close();
}
}
-----------------------------------------------------------------------------------------------------------------------
不能认怂.....................
总结
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。