views:

26

answers:

1

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

+1  A: 

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');
}
Ikke