淘先锋技术网

首页 1 2 3 4 5 6 7
$("#address_del_{{ address.id }}").click(function () {
   swal({
           title: "确认删除?",
           text: "删除后无法恢复!",
           type: "info",
           showCancelButton: true,
           cancelButtonText: "取消",
           showConfirmButton: true,
           confirmButtonText: "确定"
       }, function () {
           $.ajax({
               url: "{{ url_for('Index.addressDel') }}",
               data: {
                   "id":{{ address.id }}
               },
               success: function (data) {
                   if (data.is_success) {
                       swal({
                           title: data.message,
                           text: "",
                           type: "success"
                       }, function () {
                           window.location.reload();
                       });
                   } else {
                       swal({
                           title: data.message,
                           text: "",
                           type: "warning"
                       });
                   }
               }
           })
       }
   )
});

在这里插入图片描述

结果是,请求到了后台,问题如上图