【问题标题】:Microsoft JScript runtime error: Object doesn't support property or method 'dialog' in jQueryMicrosoft JScript 运行时错误:对象不支持 jQuery 中的属性或方法“对话框”
【发布时间】:2011-07-18 11:25:06
【问题描述】:
I have a problem of implementing the jQuery Dialog as Modal Form.



$(document).ready(function(){
$("#add-newItem")
           .button()
           .click(function () {
               alert('a');
               debugger;
               $("#dialog-form").dialog("open");
           });
});




Here execution is hitting the method and displays "Alert" as per  the code. After the it comes   to debugger and when I use "F10" it tries to execute the  "$("#dialog-form").dialog("open");

" 并得到以下错误...

Microsoft JScript 运行时错误:对象不支持属性或方法“对话框”

我已经正确地引用了 jQuery,如下所示

  <script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
  <script src="../../Scripts/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
  <link href="../../Content/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet"               type="text/css" />


What could be the problem. If check using F12 of IE9 of my displayed page, I can list out the Dialog method from the script libray. but these are not vailable for the "$("#dialog-form")

问候,

维努

【问题讨论】:

    标签: jquery-ui dialog


    【解决方案1】:

    你有&lt;div id="dialog-form" /&gt; 吗?确保 div 元素存在。

    【讨论】:

    • 是的,我遇到的基本问题是,当我查看即时窗口时,我得到 $("#dialog-form")[0].innerHTML "

      All表单字段是必需的!!!

      " 但是当寻找 $("#dialog-form").dialog(' open') 对象不支持属性或方法'dialog'
    • 你有html代码吗?还是页面的URL?如果你做 alert($("#dialog-form").html()) 怎么办?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多