-2

here is my code with jquery ui:

jQuery("#nodeliverydate").dialog({
    resizable:false,
    draggable:false,
    modal:false,
    buttons:[{text:"Close",click:function(){jQuery(this).dialog("close");}}]
});

It is a very simple code that using jquery dialog as an alert box. I defined one button to close the dialog. However, it runs in a very odd way that the dialog will contain many buttons, and the text on the buttons are all function names such as "each","all","clone","select","size", etc. And after I close it, if the dialog shows again, it will be normal. Does anyone have any idea about why this happens?

Kousik
  • 21,485
  • 7
  • 36
  • 59
CharlesDou
  • 347
  • 1
  • 7
  • 16

1 Answers1

0
jQuery("#nodeliverydate").dialog({
                    modal: true, title: 'Delete msg', zIndex: 10000, autoOpen: true,
                    width: 'auto', resizable: false,
                    buttons: {
                        Yes: function () {
                            // $(obj).removeAttr('onclick');                                
                            // $(obj).parents('.Parent').remove();

                            $(this).dialog("close");
                        },
                        No: function () {
                            $(this).dialog("close");
                        }
                    },
                    close: function (event, ui) {
                        $(this).remove();
                    }
                });

This work pretty well: Yes or No confirm box using jQuery

Community
  • 1
  • 1
Jawed El
  • 26
  • 2
  • This works for me. Thank you. But I still don't know why my code doesn't work. I used my code many times before but none of them had that kind of problem. Any ideas why? – CharlesDou Aug 02 '13 at 11:54