为什么bootbox.alert成功功能不起作用

时间:2015-09-08 08:16:23

标签: javascript php jquery ajax

这是我的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

的PHP查询
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');
}

提前致谢:)

0 个答案:

没有答案