CDN Link:

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
Footer Script
<script>
$(document).on("click", "#delete", function(e){
e.preventDefault();
var link = $(this).attr("href");
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, delete it!",
cancelButtonText: "No, cancel!",
},
function(isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
window.location.href = link;
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
});
</script>
More info:

Post a Comment

Previous Post Next Post