gpt4 book ai didi

php - 甜蜜警报(我想更新数据库状态(默认 :pending) into confirm when i click sweet alert confirm button

转载 作者:行者123 更新时间:2023-11-28 23:08:09 30 4
gpt4 key购买 nike

这是我的 sweetalert 我想在单击此确认按钮时更新我的​​数据库 STATUS 列请帮助我谢谢

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'
)
})

最佳答案

你可以在回调函数中编写你的代码

检查下面的代码

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')
}
});
})

关于php - 甜蜜警报(我想更新数据库状态(默认 :pending) into confirm when i click sweet alert confirm button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46638855/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com