-2

这是我的 jquery ui 代码:

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

这是一个非常简单的代码,jquery dialog用作警报框。我定义了一个按钮来关闭对话框。但是,它以一种非常奇怪的方式运行,对话框将包含许多按钮,并且按钮上的文本都是函数名称,例如"each","all","clone","select","size", etc. 并且在我关闭它之后,如果对话框再次出现,那就是正常的。有谁知道为什么会这样?

4

1 回答 1

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();
                    }
                });

这很好用:是或否使用 jQuery 确认框

于 2013-07-31T23:36:32.267 回答