1

SweetAlertユーザーがアカウントを削除したいときにAJAX呼び出しを使用していますが、以下は私のコードです。確認ボタンとキャンセルボタンも付けたいのですが、使い方がSweetAlertよくわかりません。

どんな助けでも大歓迎です。

のCDNを使用していSweetAlertます。

https://sweetalert.js.org/からのhttps://unpkg.com/sweetalert/dist/sweetalert.min.js

 swal({
   closeOnClickOutside: false,
   icon: "warning",
   title: 'Do you want to remove your account?',
   text: 'This action can not be undo',
   showConfirmButton: false,
   closeOnConfirm: false,
   showSpinner: true
 },function () {
   $.ajax({
     url: "delete_account.php",
     method: "POST",
     data: {
       id: 5
     },
     success: function () {
       swal("Deleted!", "Successfully deleted", "success");
     }
   });
 });
4

3 に答える 3