Solved

Object doesn't support propert or method 'dialog'

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Angular service to share objects between controllers 1 15
HTML5 Get data in table rows 5 29
how can i make 2 columns? 4 22
VBScript on Html 8 11
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…
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…

803 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