最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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; 
}
Post a comment

comment list (0)

  1. No comments so far