0

我现在有一个模态删除确认我想更改确认以使用 jQuery Modal。这是我的:

$('.stdelete').live("click", function() {
    var ID = $(this).attr("id");
    var uid = $("#uid").val();
    var dataString = 'msg_id='+ ID + '&uid=' + uid;

    if (confirm("Sure you want to deletes this update? There is NO undo!")) {
        $.ajax({
            type: "POST",
            url: "delete_message_ajax.php",
            data: dataString,
            cache: false,
            success: function(html) {
                $("#stbody"+ID).slideUp();
            }
        });
    }

有人有想法吗?谢谢你的帮助。

4

1 回答 1

0
    $('.stdelete').live("click",function()  {
        var ID = $(this).attr("id");
        var uid = $("#uid").val();
        var dataString = 'msg_id='+ ID + '&uid=' + uid;
        var d = $('<div />').append('Sure you want to deletes this update? There is NO undo!').dialog({
            buttons: {
                'no': function() {
                    $(this).dialog('close');
                },
                'yes': function() {
                    $.ajax({
                        type: "POST",
                        url: "delete_message_ajax.php",
                        data: dataString,
                        cache: false,
                        success: function(html){
                            $("#stbody"+ID).slideUp();
                        }
                    });
                    $(this).dialog('close');
                }
            }
        });
        $('body').append(d);
    });
于 2012-11-22T09:41:54.750 回答