使用ajax方式提交表单
[code="html"]
function simpleAjaxForm(formName, check){
$("#" + formName).ajaxForm({
dataType: "json",
beforeSubmit: function(){
var msg = check ? validator(check) : null;
if(msg) dialogBox(msg);
return msg ? false : true;
},
success: function(ret){
ajaxReturn(ret);
}
});
}
//ajax返回函数
function ajaxReturn(ret) {
if(ret.msg) $.prompt("系统提示", ret.msg, {submit: function(clicked){
if(ret.url) location.href = ret.url;
return true;
}});
else if(ret.url) location.href = ret.url;
}
[/code]
后台返回一个json格式的数据,{"msg":"发送成功","url":"order_apply_list.html"}
正常的话,应该是弹出一个发送成功的对话框,然后点击确定,跳转到order_apply_list.html页面才对
但是老是提示我下载保存
PS:前台表单,包含了附件上传