我需要在一个相当大的项目中使用 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/