Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery对话框按钮太多_Javascript_Jquery_Jquery Ui - Fatal编程技术网

Javascript jquery对话框按钮太多

Javascript jquery对话框按钮太多,javascript,jquery,jquery-ui,Javascript,Jquery,Jquery Ui,以下是我的jquery ui代码: jQuery("#nodeliverydate").dialog({ resizable:false, draggable:false, modal:false, buttons:[{text:"Close",click:function(){jQuery(this).dialog("close");}}] }); 使用jquery对话框作为警报框是一段非常简单的代码。我定义了一个按钮来关闭对话框。然而,它以一种非常奇怪的方式

以下是我的jquery ui代码:

jQuery("#nodeliverydate").dialog({
    resizable:false,
    draggable:false,
    modal:false,
    buttons:[{text:"Close",click:function(){jQuery(this).dialog("close");}}]
});
使用jquery对话框作为警报框是一段非常简单的代码。我定义了一个按钮来关闭对话框。然而,它以一种非常奇怪的方式运行,对话框将包含许多按钮,按钮上的文本都是函数名,如each、all、clone、select、size等。在我关闭它之后,如果对话框再次显示,它将是正常的。有人知道为什么会这样吗

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

这项工作做得很好:

我看不到这一点。让我来为你解释一下。。。查看官方文档:需要输入,提供更多信息,因为这似乎不是你问题的全部背景。这对我很有用。非常感谢。但我仍然不知道为什么我的代码不起作用。我以前用过很多次我的代码,但是没有一个有这样的问题。你知道为什么吗?