运行时错误:对象不支持属性或方法 [英] runtime error: Object doesn't support property or method

查看:1349
本文介绍了运行时错误:对象不支持属性或方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在pretty大项目,以创建使用jQuery的对话框。在一些地方,这个项目使用jQuery至极的版本是我使用的一个最近我的窗口不同。

我的code是这样的:

ASCX页

 < HTML和GT;
< HEAD>
  <链接类型=文/ CSS的href =CSS / jQuery的-UI-1.8.22.custom.css的rel =stylesheet属性/>
  <脚本类型=文/ JavaScript的SRC =JS / jQuery的-1.7.2.min.js>< / SCRIPT>
  <脚本类型=文/ JavaScript的SRC =JS / jQuery的-UI-1.8.22.custom.min.js>< / SCRIPT>
  <脚本类型=文/ JavaScript的SRC =JS / myjQuery code.js>< / SCRIPT>
< /头>
<身体GT;
< /身体GT;
< / HTML>

在myjQuery code.js文件

  $(文件)。就绪(函数(){
    $(#对话框的形式)。对话框({
        的AutoOpen:假的,
        高度:440,
        宽度:500,
        模式:真实,
        closeOnEscape:假的
    });
});

在运行时,我得到的错误:


  

微软JScript运行时错误:对象不支持属性或
  方法对话框



解决方案

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

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'

解决方案

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

这篇关于运行时错误:对象不支持属性或方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆