SweetAlert
当用户想要删除帐户时,我正在使用AJAX 调用。但我的代码在下面不起作用。我还想添加确认和取消按钮,但我不知道如何使用SweetAlert
得很好。
任何帮助将不胜感激。
我正在使用.SweetAlert
https://unpkg.com/sweetalert/dist/sweetalert.min.js来自https://sweetalert.js.org/
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");
}
});
});