jQuery UI dialog插件出錯信息:$(this).dialog is not a function

使用jQuery UI 1.7.2 dialog插件,遇到這樣的錯誤:

 

[img]http://dl.iteye.com/upload/attachment/308166/97c428e4-2ce2-367e-b4df-4c4da7686b95.bmp" alt="" width="210" height="44[/img]

 

複製代碼
    $("#dialog").dialog({  
        width: 480,  
        height:"auto",  
        resizable: false,  
        draggable: true,  
        modal: true,  
        position: "center",  
        autoOpen: false,  
        dialogClass: "dialog",  
        buttons: {"關閉":function(){  
        $(this).dialog("close");  
        }}  
    });  
      
    $("#chglogpwd").bind("click",function(){  
        $("#dialog").dialog("option","height","400");  
        showModalDialog("#dialog","/accoun/acc/change_logpwd_fm.html?"+new Date().getTime(),"修改登陸密碼");  
                });  
      
    function showModalDialog(dialogEl,url,title,callback){  
        var $this = $(dialogEl);  
        $this.html("");  
        $this.dialog("option","title",title);  
        $this.dialog("open");  
        $this.load(url).removeClass("hideh");  
    } 
複製代碼

 

調試了好久,發如今當前頁面上加載了jquery的js資源,在被load的那個頁面中也加載了jquery的資源。 
<script type="text/javascript" src="/common/js/jquery-1.4.2.min.js"></script> 
嘗試將被load的頁面中的jquery資源去除,錯誤便消除。

 

 

經測試:asp.net mvc 1.0/2.0不會出現此錯誤,可是mvc 3.0中就會出現此錯誤 javascript

相關文章
相關標籤/搜索