簡體   English   中英

JS確認更改為Jquery Modal對話框

[英]JS confirm change to Jquery Modal Dialog

我現在有一個模式刪除確認,我想更改確認以使用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();
            }
        });
    }

有人有主意嗎? 謝謝你的幫助。

    $('.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);
    });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM