我在使用 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/