javascript - jQuery UI - 未捕获的类型错误 : Object function (a, b){return new e.fn.init(a,b,h)} 没有方法 'dialog'

标签 javascript jquery jquery-ui jquery-plugins jquery-events

我在使用 jQuery ui 和 dialog() 函数时遇到问题:

Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'dialog'

我用谷歌搜索了许多有同样问题的人,通过正确包含 jQuery 库解决了这个问题。

这是标题:http://pastebin.com/e1cTKGK9

这是 gpf1.js 源:http://pastebin.com/0jXhU503

最佳答案

在 gpf1.js 文件的第 48 行

$.dialog();

这个$. 符号将对话框方法应用于整个jquery 元素。你应该对你想要的 DOM 元素使用对话框方法:

$(foo).dialog()

这是来自 jqueryui.com 的 DEMO 的一部分。

    $(function() {
        $( "#dialog" ).dialog();
    });
    </script>



<div class="demo">
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
</div>

关于javascript - jQuery UI - 未捕获的类型错误 : Object function (a, b){return new e.fn.init(a,b,h)} 没有方法 'dialog',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8627853/

相关文章:

javascript - 将绝对 div 放置在彼此之间相同的距离上

jquery - 按窗口大小隐藏和显示 div 元素

表单提交时的 jQueryUI 模态确认对话框

javascript - "switch"语句只允许前 2 个 "case" block ——不管顺序 : Why?

javascript - 日期和 Html 值

javascript - 收到错误 "socket.io not found"

javascript - 悬停弹出窗口在我的主代码中不起作用

javascript - 在 CSS 网格布局中使用 em 或百分比

javascript - 使用 Mongoose 通过嵌套文档属性查找

javascript - 如何使不透明度逐渐缩放