这是我的Delete function
$("#Delete").click(function(e) {
e.preventDefault();
bootbox.confirm("Are you sure you want to delete order?","No","Yes",function(r){
if(r) {
$.ajax({
url : url,
type : "POST",
async : false,
data : {
empgrocmstID:1,
todo:"Delete"
},
success:function(result){
bootbox.alert("Order Deleted",function(){
$("#Delete").attr("disabled", true);
});
updateTable();
}
});
} else {
}
});
});
这是我的Delete button
<button id="Delete" role="button" class="btn btn-danger" disabled>Delete Order</button>
这是我对Delete
case "Delete":
$Deletequery = "DELETE FROM tb_empgroc_master WHERE empgrocmstID='id'";
mysql_query($Deletequery, $con);
break;
问题是bootbox.alert
无法正常工作,bootbox.confirm
显示。仅当我删除url:url,
显示的代码bootbox.alert
时。 ajax中的url:url,
有什么问题?
这是我在html中的table form
<form class="form-horizontal" id="main-form" action="../process/PHP_groceryOnlineReleasing.php" method="POST">
<table class="tablesorter table table-bordered table-condensed" id="cLoanOut" style="table-layout: fixed;">
这是我调用url
url form
的脚本
<script type="text/javascript">
$(function(){
var $table = $('#cLoanOut'),$tbody = $('#cLoanOut tbody'), url = $('#main-form').attr('action'), currentSort;
</script>
发布url
function updateTable(){
$.post(url,{todo:"display"},function(response){
$('.progress').hide();
$tbody.html(response);
$table.trigger('update');
},'html');
}
提前致谢:)