Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

runtime error: Object doesn't support property or method

I need to create a dialog with jQuery in a pretty big project. In some places, this project uses jquery wich version is different from the one I use recent for my window.

My code looks like this:

on ascx page

<html>
<head>
  <link type="text/css" href="css/jquery-ui-1.8.22.custom.css" rel="stylesheet" />
  <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
  <script type="text/javascript" src="js/jquery-ui-1.8.22.custom.min.js"></script>
  <script type="text/javascript" src="js/myjQueryCode.js"></script>
</head>
<body>
</body>
</html>

in myjQueryCode.js file

$(document).ready(function() {
    $("#dialog-form").dialog({
        autoOpen: false,
        height: 440,
        width: 500,
        modal: true,
        closeOnEscape: false
    });
});

At runtime, I get the error:

Microsoft JScript runtime error: Object doesn't support property or method 'dialog'

like image 438
user1439618 Avatar asked Dec 17 '25 22:12

user1439618


2 Answers

Thanks for your answers. The problem was that the library was included multiple times in different files.

like image 196
user1439618 Avatar answered Dec 19 '25 10:12

user1439618


The dialog method is from the jQuery UI library. It looks like you are using a custom version of jQuery UI, which may not include dialog.

You can customize which modules to include in jQuery UI here: http://jqueryui.com/download

like image 40
bohawi Avatar answered Dec 19 '25 10:12

bohawi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!