简体   繁体   English

该功能在第二次调用时不起作用

[英]Function doesn't work at second call

i have this function 我有这个功能

function notify()
    {
    alert('oo');
        $("#SuccessNotification").dialog({
        bgiframe: true,
        modal: true,
        title: 'success',
        buttons: {
            Ok: function() {
                $(this).dialog('close');                

            } 
        }
            });
    }

the alert works each time this function is called but the dialog is getting poped out only first time 每次调用此函数时警报都会起作用,但对话框仅在第一次弹出

You have to call the dialog with the open argument like this: 您必须使用open参数调用对话框,如下所示:

function notify()
{
    alert('oo');
    var elem = $("#SuccessNotification")
    elem.dialog({
    bgiframe: true,
    modal: true,
    title: 'success',
    buttons: {
        Ok: function() {
            $(this).dialog('close');                

        } 
    }
        });
    elem.dialog('open');
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM