我想在用户确认后执行一些php代码。我的意思是如果用户点击是的一些PHP函数应该执行。我该怎么做?bootbox后如何使用php代码确认提醒
bootbox.confirm({
message: "This is a confirm with custom button text and color! Do you like it?",
buttons: {
confirm: {
label: 'Yes',
className: 'btn-success'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
console.log('This was logged in the callback: ' + result);
}
});
在回调函数中,您将向运行代码的PHP页面发出AJAX请求。 – David
已经有回拨块了;你可以使用alert来检查按钮的值:'callback:function(result){alert(result);}' – bharat
在回调函数中,我该如何编写php代码? – rivas