点击按钮确认


jQuery Confirm on click of button

我有以下代码,它与从输入到input框的数据中给出的"值"一起工作。

我如何修改这段代码,只发送数据- product_details['id']而不需要input数据?

jQuery示例代码:
    $('body').on("click", "#product_change_set_order_btn", function (e) {
        e.preventDefault();
        var box = $("#product_set_order_box");
        var id = box.data("id"); 
        var url = box.data("url");              
        var data_array = { 
                id : id, 
                new_sort : box.val(), 
            };
        if($.trim(box.val()) != "")
        {
            ajaxCall(url, data_array, null, "product_set_order");
            alert("Your Sort Order Has Been Set");
        }
    });

HTML按钮:

 <a href="#" class="btn btn-danger" title="Delete <?php echo $product_details['name']; ?>" data-name="<?php echo $product_details['name']; ?>" data-id="<?php echo $product_details['id']; ?>" data-url="admin/PS_products/ajax_product_delete">Delete <?php echo $product_details['name']; ?></a>
   $('body').on("click", "#product_change_set_order_btn", function (e) {
        e.preventDefault();
        var box = $("#product_set_order_box");
        var id = box.data("id"); 
        var url = box.data("url");              
        var data_array = { 
                id : id, 
                new_sort : box.val(), 
            };
            ajaxCall(url, data_array, null, "product_set_order");
            alert("Your Sort Order Has Been Set");
    });