0

I am making a custom alert from this url . http://coding.abel.nu/2012/01/jquery-ui-replacement-for-alert/ I am able to make simple alert .But I need to do some work on "ok" button , use callback function.I got the error "undefined not function" .here is my fiddle http://jsfiddle.net/uV2Nv/

 $.extend({
        confirm: function(message, title, okAction) {
            $("").dialog({
                // Remove the closing 'X' from the dialog
                open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }, 
                buttons: {
                    "Ok": function() {
                        $(this).dialog("close");
                        okAction();
                    },
                    "Cancel": function() {
                        $(this).dialog("close");
                    }
                },
                close: function(event, ui) { $(this).remove(); },
                resizable: false,
                title: title,
                modal: true
            }).text(message);
        }
    });

    function okAction(){
     alert('--')   
    }
    $.alert("message", "title",okAction)
Shruti
  • 1,524
  • 8
  • 29
  • 63

0 Answers0