-
Anonymous
Как использовать сладкое оповещение
Сообщение
Anonymous »
Это мой HTML-код
У меня есть две кнопки ввода, на которых я хочу отображать приятное оповещение, когда пользователь нажимает на любую кнопку
Скрипт
Код: Выделить всё
$(document).ready(function () {
document.querySelector('td.warning input').onclick = function () {
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 plx!",
closeOnConfirm: false,
closeOnCancel: false
},
function (isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted!", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
};
});
Только первая кнопка ввода показывает Sweet Alert, но
когда я нажимаю вторую кнопку, ничего не происходит
Подробнее здесь:
https://stackoverflow.com/questions/278 ... weet-alert
1731864191
Anonymous
Это мой HTML-код
У меня есть две кнопки ввода, на которых я хочу отображать приятное оповещение, когда пользователь нажимает на любую кнопку
[code]
1
adminMohammad
Farzin
2
1111
11
[/code]
Скрипт
[code]$(document).ready(function () {
document.querySelector('td.warning input').onclick = function () {
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 plx!",
closeOnConfirm: false,
closeOnCancel: false
},
function (isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted!", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
};
});
[/code]
Только первая кнопка ввода показывает Sweet Alert, но
когда я нажимаю вторую кнопку, ничего не происходит
Подробнее здесь: [url]https://stackoverflow.com/questions/27835246/how-to-use-sweet-alert[/url]