亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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

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

Cats萌萌 2018-08-09 08:09:39
前臺代碼$("#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提交哪里沒有辦法處理結果
查看完整描述

1 回答

?
RISEBY

TA貢獻1856條經驗 獲得超5個贊

  $("#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(); // 提交后重置表單
        });


查看完整回答
反對 回復 2018-08-27
  • 1 回答
  • 0 關注
  • 1552 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號