Solved

Object doesn't support propert or method 'dialog'

Posted on 2011-09-20
5
2,790 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
make control visible based off other control value 7 40
How do I post more than 1 item to php backend 24 53
Diff of the day 2 36
Textbox autocomplete using jquery in asp.net 13 42
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

740 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