这是我的sweetalert我想更新我的数据库STATUS列,当我点击这个确认按钮时PLZ帮帮我谢谢
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#228B22',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, confirm it!'
}).then(function () {
swal(
'Confirmed!',
'success'
)
})
答案 0 :(得分:1)
您可以在回调函数中编写代码
检查以下代码
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#228B22',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, confirm it!'
}).then(function () {
// write your code in the response of ajax call
$.ajax({
url:"",
success:function(resp){
swal('Confirmed!','success')
}
});
})