1

I know a lot of people have had this issue, and I've seen that for these guys its reference duplication. But for me I cannot see anywhere anything that has been duplicated.

Here is my code:

HTML

<title>The HUB</title> <link rel="stylesheet" href="/css/styles.css" type="text/css" /> 
<link rel="stylesheet" href="/css/jquery.ui.all.css"> 
</head> 
<body> 
<script type="text/javascript" src="/js/jquery-1.6.2.min.js"></script> 
<script type="text/javascript" src="/js/hub.js?n=1"></script> 
<script type="text/javascript" src="/js/testSignal.js"></script>  
<script type="text/javascript" src="/js/ui/jquery.ui.core.js"></script> 
<script type="text/javascript" src="/js/ui/jquery.ui.widget.js"></script>  
<script type="text/javascript" src="/js/ui/jquery.ui.mouse.js"></script>  
<script type="text/javascript" src="/js/ui/jquery.ui.draggable.js"></script> 
<div id="wrapper"> ....  <div id="dialog"><p>Some Text</p></div></div>

jQuery

$(document).ready(function(){
    $("#dialog").dialog({ autoOpen: false });
    $("#testSignalBtn").click(function(){
        $("#dialog").dialog("open");
        return false;
    });
});

Ive tried reordering all of the javscript files, enabling some and not others etc, and it doesn't seem to work. The file hub.js?n=1 does use jQuery and has no problems. - It's not a file I wrote, I've take over this from someone else. And I have tried disabling that file, but I still get the same problem.

Here is what other people have said on the same thing: Uncaught TypeError: Object [object Object] has no method 'dialog' and here too: jQuery Uncaught TypeError: Object[object Object] has no method slider

6
  • 1
    Sorry if this sounds silly, but did you also include jquery.ui.dialog.js? Commented Aug 17, 2012 at 15:25
  • No you're not silly, i've just downloaded that file and it seems to have sorted it. I initially assumed that the dialog was included in the widget file, and didn't occur to me that it wouldn't be. The original developer of this site has caused me so many problems, when trying to add new features etc. Thanks pimvdb :) Commented Aug 17, 2012 at 15:33
  • I feel like an idiot now asking this question... Commented Aug 17, 2012 at 15:44
  • No you're not, perhaps you just looked at it for too long :) Commented Aug 17, 2012 at 15:47
  • Thanks, I definitely looked at it too long, and couldn't see the obvious. Commented Aug 21, 2012 at 8:12

3 Answers 3

7

dialog, like draggable, is a widget. You'd have to include it if you want to use it:

<script type="text/javascript" src="/js/ui/jquery.ui.dialog.js"></script>  
Sign up to request clarification or add additional context in comments.

Comments

6

Instead of having all of those separate files, just include the entire jQuery UI CDN link:

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/jquery-ui.min.js"></script>

Just tried it in a fiddle and everything you have works fine, it must be a missing .js file.

http://jsfiddle.net/nU5TF/

Comments

0

As pimvdb stated above, dialog is a widget. However, many projects do not use the separate widget include files but one customizable compiled and minified version. To make sure that the dialog widget was included in your build, open the jquery-ui.js file in a text editor: the header tells you which components are included, like so:

/*! jQuery UI - v1.10.0 - 2013-02-14
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js
* Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */

In my case almost everything except the dialog widget was included.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.