0

我无法将 JconfirmAction 与此代码进行比较:

<script type="text/javascript">
$(function () {
    $(".delbutton").click(function () {
        //Save the link in a variable called element
        var element = $(this);
        //Find the id of the link that was clicked
        var del_id = element.attr("id");

        //Built a url to send
        var info = 'id=' + del_id;
        if (confirm("Sure you want to delete this update? There is NO undo!")) {
            $.ajax({
                type: "GET",
                url: "ajax_delete.php",
                data: info,
                success: function () {

                }
            });
            $(this).parents(".record").animate({
                backgroundColor: "#fbc7c7"
            }, "fast")
                .animate({
                opacity: "hide"
            }, "slow");
        }
        return false;
    });
});
</script>

我尝试使用以下代码将此脚本添加到存在页面:

<script type="text/javascript">
    $(document).ready(function() {
        $('.ask-custom').jConfirmAction({question : "Usunąć ?", yesAnswer : "Tak", cancelAnswer : "Nie"});
    });
</script>

链接class

<a href="#" id="<?php echo $row['id']; ?>" title="DELETE" class="ask-custom delbutton">

任何提示?此致。

4

1 回答 1

0

尝试更改您的ajax请求:

$.ajax({
                type: "GET",
                url: "ajax_delete.php",
                data: {id:del_id},
                success: function () {

                }
            });
于 2013-04-21T11:00:24.653 回答