开发者

Function doesn't work at second call

开发者 https://www.devze.com 2022-12-19 06:08 出处:网络
i have this function function notify() { alert(\'oo\'); $(\"#SuccessNotification\").dialog({ 开发者_JS百科bgiframe: true,

i have this function

function notify()
    {
    alert('oo');
        $("#SuccessNotification").dialog({
    开发者_JS百科    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:

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

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

精彩评论

暂无评论...
验证码 换一张
取 消