Solved

Object doesn't support propert or method 'dialog'

Posted on 2011-09-20
5
2,750 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

680 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