每次我想添加x产品时,我都有一个名为add的按钮,我做了一个动态删除按钮。问题是删除按钮,因为我想按删除按钮,但如果我想删除或取消它不会打开确认,但如果我双击它有效,但我知道它是坏的
function btn_del_product(id) {
$('#confirm').confirm({
text: 'are you sure you want to delete this product?',
title: 'Confirmation required',
confirm: function(button) {
$.ajax({
url: '../controllers/sales.php',
type: 'POST',
data: 'id=' + id + '&boton=delete'
}).done(function(ans) {
view_sales();
});
},
cancel: function(button) {},
confirmButton: "Yes",
cancelButton: 'No',
post: true,
confirmButtonClass: 'btn-danger',
cancelButtonClass: 'btn-default',
});
}