我尝试让以下代码工作
//===== Dialogs =====//
$(".table a.delete").click(function (e) {
e.preventDefault();
bootbox.confirm("Are you sure?", function (confirmed) {
if (confirmed) {
var $el = $(this);
var $tr = $el.closest('tr');
var url = $el.closest('table').data('remove-url');
var id = $tr.data('id');
$tr.fadeOut(function () {
$el.remove();
$.post(url, { id: id }); // do the delete on the server
});
}
});
});
启动箱正在显示,但下面的代码if(confirmed)
没有运行。