最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin4浏览0评论

I have a problem using jQuery ui and dialog() function:

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

I've googled around many people with the same problem solved that issue with a correct inclusion of jQuery library.

This is the header:

And this is the gpf1.js source:

I have a problem using jQuery ui and dialog() function:

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

I've googled around many people with the same problem solved that issue with a correct inclusion of jQuery library.

This is the header: http://pastebin./e1cTKGK9

And this is the gpf1.js source: http://pastebin./0jXhU503

Share Improve this question edited Jun 8, 2019 at 15:46 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Dec 25, 2011 at 1:53 LukeLuke 1,84410 gold badges44 silver badges73 bronze badges 1
  • In the future, please post some code in the question itself (don't rely on external sites). Also: try to narrow down the problem to a specific piece of code, so you don't have to post a "wall of code". Have a look at How to Ask. – Peter-Paul van Gemerden Commented Dec 25, 2011 at 13:49
Add a ment  | 

2 Answers 2

Reset to default 3

In line 48 in your gpf1.js file

$.dialog();

This $. sign applies the dialog method to the whole jquery element. you should use the dialog method to a DOM element you want like:

$(foo).dialog()

And here's part of the DEMO from jqueryui..

    $(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>

This can be fixed with the snippet bellow

// http://bugs.jquery./ticket/11921
if(! $.isFunction($.fn.curCSS)) {
   $.curCSS = $.css; 
   $.fn.curCSS = $.fn.css; 
   var mouseY, lastY = 0; 
}

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论