Я добавил fire
в Swal и запустил его - Похоже, все работает нормально - Раньше были ошибки - Но у вас также есть много закрывающих скобок в вашей функции - есть ошибки консоли?
Использование SweetAlert 2
Swal.fire({
title: "Are you sure?",
text: ("You want to delete this Subscription !"),
//type: "warning", - doesn't exist
showCancelButton: true,
confirmButtonColor: '#d33',
confirmButtonText: "Yes",
//closeOnConfirm: false - doesn't exist
})
.then(function (isConfirm) {
if (isConfirm) {
}
});
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9.17.1/dist/sweetalert2.all.min.js"></script>
Используя SweetAlert 1, я добавил комментарии, объясняющие, что происходит
swal({
title: "Are you sure?",
text: ("You want to delete this Subscription !"),
type: "warning", //type and imageUrl have been replaced with a single icon option.
icon:'warning', //The right way
showCancelButton: true, //showCancelButton and showConfirmButton are no longer needed. Instead, you can set buttons: true to show both buttons, or buttons: false to hide all buttons. By default, only the confirm button is shown.
confirmButtonColor: '#d33', //you should specify all stylistic changes through CSS. As a useful shorthand, you can set dangerMode: true to make the confirm button red. Otherwise, you can specify a class in the button object.
confirmButtonText: "Yes", // everything is in the buttons argument now
closeOnConfirm: false,
buttons:true,//The right way
buttons: ["No", "Yes"] //The right way to do it in Swal1
})
.then(function (isConfirm) {
if (isConfirm) {
}
});
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>