繁体   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