runtime error: Object doesn't support property or method
Solution 1
Thanks for your answers. The problem was that the library was included multiple times in different files.
Solution 2
View the page's HTML to see if there are script references to other versions of jquery in the page. If an older version is loaded after the correct version then invalid methods will throw exceptions.
Solution 3
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
user1439618
Updated on May 09, 2020Comments
-
user1439618 about 4 years
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'
-
user1439618 almost 12 yearsWhen I use this code in a separate asp.net project, it works well.
-
bohawi almost 12 yearsDoes the other project use the same jquery-ui-1.8.custom.min.js file?
-
bohawi almost 12 yearsYou can download the full jQuery UI library at the link in the answer, or Google can host it for you: <script type="text/javacsript" src="ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js">
-
user1439618 almost 12 yearsYes, the file in the other project is exactly the same. Thank you for the link, but when I include it, result is the same error.
-
user1439618 almost 12 yearsCould it be some kind of conflict in jQuery files?