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

时间:2011-07-18 11:25:06

标签: jquery-ui dialog

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的refence,如下所示

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

的问候,

Vinu

1 个答案:

答案 0 :(得分:0)

你有<div id="dialog-form" />吗?确保div元素存在。