Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3090
  • Last Modified:

Object doesn't support propert or method 'dialog'

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
tonelm54
Asked:
tonelm54
3 Solutions
 
chaitu chaituCommented:
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
 
garykristenCommented:
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
 
JohnSixkillerCommented:
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
 
Ivo StoykovCommented:
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
 
tonelm54Author Commented:
Ok, thank you, dont know how I missed that mistake, but thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now