form 表单 ajaxSubmit 提交后接收不到返回值

前台代码

$("#formSave").ajaxSubmit({

success: function (data) {

ShowMsg(data.message)
if (data.success) {
window.location.href = "/CouponManage/BusinessCoupon/List";
}
},
error: function (data) {
ShowMsg(data.message);
}
});

后台代码

public JsonResult UpdateSave()
{

Guid guid = new Guid(Request["CouponGuid"]);
string Title = Request["title"];
string Detial = Request["desc"];
string msg = "";
CouponLogic bll = new CouponLogic(this.OpertorGuid);
Coupon coup = new Coupon();
coup.Guid = guid;
coup.Title = Title;
coup.Description = Detial;

bool flag = bll.UpdateCoupon(UserAccount, ChainStoreGuid, coup, out msg);

return Json(new { success = flag, msg = msg });

}

结果直接在浏览器里面输出了 

{"success":true,"message":"修改成功!"}

 

ajax提交哪里没有办法处理结果


Cats萌萌
浏览 1558回答 1
1回答

RISEBY

  $("#formSave").ajax({             type: 'post', // 提交方式 get/post             url: 'your url', // 需要提交的 url            data: {                'title': title,                'desc': desc,                'CouponGuid':CouponGuid             },             success: function(data) { // data 保存提交后返回的数据,一般为 json 数据                // 此处可对 data 作相关处理                 alert('提交成功!');             }             $(this).resetForm(); // 提交后重置表单         });
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java