javascript - 运行时错误 : Object doesn't support property or method

标签 javascript jquery asp.net jquery-ui

我需要在一个相当大的项目中使用 jQuery 创建一个对话框。在某些地方,这个项目使用的 jquery 版本与我最近为我的窗口使用的版本不同。

我的代码是这样的:

在 ascx 页面上

<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>

在 myjQueryCode.js 文件中

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

在运行时,我得到错误:

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

最佳答案

感谢您的回答。问题是该库在不同文件中多次包含。

关于javascript - 运行时错误 : Object doesn't support property or method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11881045/

相关文章:

c# - 带有制表符分隔文本文件的 StreamReader

javascript - 帮助减少 document.getelementbyid dom 调用或重写算法

jQuery 更改 iFrame 的内容

javascript - 使用 jQuery.append 插入 iframe 的内容后消失

javascript - 使用 javascript 更改动态创建的 ASP.NET 图像控件

c# - 针对 4.7.2 的 Asp.net 网站项目无法使用 MSBuild 解析 .netstandard 2.0 引用

javascript - 为什么 Javascript 函数在创建时返回 "undefined"?

javascript - php在html内循环时发生循环错误

php - 我如何用 php 而不是 javascript 编写这个分割

javascript - jQuery 在两个单独的 div 中按类名选择复选框