Ajax向服务器插入数据

    xiaoxiao2021-12-04  24

    function InsertCouponInfo() { GetCurrentcouponinfo(); var yanzheng = "";//后台controller处理方法 $.ajax({ url: yanzheng,//url路径 type: "POST",//请求类型 data:JSON.stringify({couponid:codeid,couponcode:couponcode,disCount:needmoney,discountType:codetype,applyObject:applyobject,couponValidType:"0", beginDateTime:starttime,endDateTime:endtime,remarkInfo:remark,createDateTime:createdatatime,usedCount:"0",validCount:validcount}),//向后台controller中的方法参数传值,参数标签必须与后台方法参数名称一致 contentType: "application/json",//预期服务器返回的数据类型 success: function (result) {//请求成功处理事件 if (result.result == true) { alert("保存成功"); $("#editdiv").hide(); ValidType = 0; InsertSuccess($("#firsttr")); } }, error:function(){//请求错误处理函数 } }); }
    转载请注明原文地址: https://ju.6miu.com/read-680300.html

    最新回复(0)