Am using SweetAlert
to do an AJAX call when user want to delete an account.But isn't working below is my code. I want to also add confirm and cancel button but I don't know how to use SweetAlert
very well.
Any help will be appreciated.
I'm using CDN of SweetAlert
.
https://unpkg.com/sweetalert/dist/sweetalert.min.js from 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");
}
});
});