Jquery对话框 - 对象不支持此属性或方法

我的这段代码工作正常,直到我升级到Jquery更新的版本。现在我犯了错误。
 <link rel="stylesheet" type="text/css" href="site.css" />
    <link type="text/css" href="css/smoothness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />   
     <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>    
    <script type="text/javascript" src="js/ddsmoothmenu.js"></script>

    <script type="text/javascript">    
         $(document).ready(function(){     
                $('#dialog').dialog({
                    modal: true,
                    autoOpen: false,
                    width: 760,
                    height: 'auto',             
                    close: function(event, data) {
                        $('#mainFrame')[0].src = "LoadingPage.aspx";
                    }
                });
                $('a[name="dia"]').click(function(){
                    $('#mainFrame')[0].src = this.file;
                    $('#dialog').data('title.dialog', this.innerText); 
//                    $('#dialog').data('width.dialog', this.diaWidth); 
//                    $('#dialog').data('height.dialog', this.diaHeight); 
                    $('#dialog').dialog('open');
                    return false;
                });             

                if (document.getElementById('hidIsAdmin').value == "1"){
                    document.getElementById('liAdmin').style.display = 'block';
                    document.getElementById('liReports').style.display = 'block';
                }else {
                    $('#liAdmin').remove();
                    $('#liReports').remove();

                }
                if (document.getElementById('hidCreate').value == "1"){
                    document.getElementById('liCreate').style.display = 'block';
                }else {
                    $('#liCreate').remove();
                    $('.edit_icon_link').hide(0);                   
                }
            });
            function hideEditIcon(){
                $('.edit_icon_link').hide(0);                   
            }            
    </script>
    
已邀请:
我有类似的事情发生(将MVC3 ASP转换为Razor),在我的情况下,将我的
jquery-1.4.4.min.js
引用移动到我的母版页帮助。 我说“帮助”,因为现在开放工作,但
$(this).dialog("close");
没有。
function ShowPopUp(strDivName)
{
    $("div[id$='" + strDivName + "']").dialog(
        {
            title: "blah blah blah",
            width: 600,
            modal: true,
            resizable: true,
            closeOnEscape: false,
            buttons:
            {
                "Save": function () { SaveThis(); $(this).dialog("close"); },
                "Cancel": function () { $(this).dialog("close"); }
            }
        }
    );
    $("div[id$='" + strDivName + "']").dialog("open");
}
    
检查可用于对话框的选项,我认为autoResize已重命名为可调整大小。     
你有可能没有关闭你的
$(document).ready(function(){
吗? 你在上面显示的ѭ5closes关闭了
$('#dialog').dialog({
但是我没有看到
$(document).ready(function(){
的结束。     
我遇到了IE8的这个问题,因为我在HTTPS页面上,但是从HTTP CDN加载了jquery-ui包。我一改变了网址 http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js 至 https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js 它开始工作了。     
我现在正在使用MVC4。所以我不得不将jquery-ui-1.8.20.js添加到App_Start下的
BundleConfig.RegisterBundles()
以使其工作:
bundles.Add( new ScriptBundle( "~/bundles/jquery" ).Include(
  "~/Scripts/jquery-{version}.js",
  "~/Scripts/jquery-ui-1.8.20.js" ) );
    

要回复问题请先登录注册