2013-05-06 105 views
0

我已經導入所有.js運行此功能所需的文件和UI文件... 當我使用Google CDN執行此代碼時,它的工作正常。但是,當我嘗試使用相同的CDN文件運行的.js文件裏面的項目文件,它會引發錯誤cancel is not a function..jquery對話框錯誤

$("#dialog-form").dialog({ 
     autoOpen: false, 
     height: 250, 
     width: 350, 
     modal: true,   

     buttons: { 
      "Buy Now": function() {   
       $(this).dialog("close");   
       var folionumber=$("#folionum").val(); 
       //---------------code change-------- 
       var firsturl = "https://www.sbimf.com/INVESTORCENTER/ASPX/frmNew_Purchase.aspx?id="; 
       var id=1; 
       var calledfrom = "&calledfrom=asset&fol_no=" + folionumber + "&chk_digit=&opt=B&SchemeCode=" + schemecode + "&url=" + encurl; 

       var finalurl=firsturl+id+calledfrom; 

       // alert(finalurl); 
       window.open(finalurl, "_parent");  
       // window.open("http://172.24.10.203/INVESTORCENTER/ASPX/frmNew_Purchase.aspx?id=1&calledfrom=PortFolio&fol_no=13627577&chk_digit=&opt=B&SchemeCode=D018");  
      }, 
      Cancel: function() { 
       $(this).dialog("close"); 
      } 
     },  

     open: function() { 
      $(this).parents(".ui-dialog:first").addClass("dialog_style1"); 
      $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("titlebar"); 
      $(this).parents(".ui-dialog:first").find(".ui-dialog-buttonpane").addClass("dialog_style1"); 
      $(this).parents(".ui-dialog:first").find(".ui-dialog-buttonpane").find(".ui-dialog-buttonset").find(".ui-button").find(".ui-button-text").addClass("btncss"); 
      $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").find(".ui-dialog-titlebar-close").addClass("smallbutton"); 

     } 
}); 
+1

所以,你如何包含那些'.js'文件 – 2013-05-06 08:06:43

+0

確保你包含'.js'文件的順序是正確的jquery,jqueryui,css文件) – 2013-05-06 11:08:03

回答

0

我的問題就解決了。我已經鏈接了舊的JS文件。我用新的JS取代了它,現在它的工作流暢了