Solved

Object doesn't support propert or method 'dialog'

Posted on 2011-09-20
5
2,571 Views
Last Modified: 2012-05-12
This is my first attempt at a jQueryUI dialog, and Im stuck.

I have read and re-read the quick-start tutorial, but cannot figure out why my code doesnt work.

Everything I belive should be included is included, yet I still get the message saying dialog doesnt exist.

Any ideas where Ive gone wrong :-S

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script type="text/javascript" src="..\jquery-1.6.4.js"></script>
    <script type="text/javascript" src="..\jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#trigger").click(function () {
                $("#dialog-modal").dialog("destroy");
                $("#dialog-modal").dialog({
                    height: 140,
                    modal: true
                });
                })
            })
    </script>
    <title></title>
</head>
<body>
<div id="trigger">Trigger</div>
<div id="dialog-modal" style="display:none;" title="Basic modal dialog">Hello Banannas</div>
</body>
</html>

Open in new window


The jQueryUI file I downloaded is below:-
 jquery-ui-1.8.16.custom.min.js
0
Comment
Question by:tonelm54
5 Comments
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 167 total points
ID: 36565354
above script is not finding below js files.check the path properly

<script type="text/javascript" src="..\jquery-1.6.4.js"></script>
    <script type="text/javascript" src="..\jquery-ui-1.8.16.custom.min.js"></script>
0
 
LVL 3

Expert Comment

by:garykristen
ID: 36565380
Hi tonelm54

You need to just defined this code in footer
This one code

<script type="text/javascript">
        $(document).ready(function () {
            $("#trigger").click(function () {
                $("#dialog-modal").dialog("destroy");
                $("#dialog-modal").dialog({
                    height: 140,
                    modal: true
                });
                })
            })
    </script>
0
 
LVL 11

Assisted Solution

by:JohnSixkiller
JohnSixkiller earned 167 total points
ID: 36565381
Chaituu is right the code you have posted is ok. Check your paths. Maybe it will be something like this "../js/jquery-ui-1.8.16.custom.min.js or js/jquery-ui-1.8.16.custom.min.js". Or use absolute paths. And dont forget to add CSS link as well.
0
 
LVL 22

Assisted Solution

by:Ivo Stoykov
Ivo Stoykov earned 166 total points
ID: 36565387
use absolute path - i.e.
instead of
<script type="text/javascript" src="..\jquery-1.6.4.js"></script>
use
<script type="text/javascript" src="/scripts/jquery-1.6.4.js"></script>
in the above declaration it is supposed that jquery-1.6.4.js is located in /scripts which is sub-directory of your web server root directory

HTH

Ivo Stoykov
0
 

Author Comment

by:tonelm54
ID: 36565618
Ok, thank you, dont know how I missed that mistake, but thank you!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now