2017-04-13 25 views
1

我使用$ .getScript加載ckeditor.js文件,並在回調函數中啓動CKEditor。但它顯示錯誤TypeError:c [a]未定義。這是我的代碼。我該如何解決這個問題?TypeError:c [a]在CKEditor中未定義

$.getScript("ckeditor.js", function (data, textStatus, jqxhr) { 
    if (textStatus == 'success' && jqxhr.status == 200) { 
     CKEDITOR.replace('commentBox', 
     { 
      toolbar : 
      [ 
       { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, 
       { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Blockquote'] }, 
       { name: 'insert', items : [ 'Table','HorizontalRule','SpecialChar' ] }, 

       { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] }, 
       { name: 'colors', items : [ 'TextColor','BGColor' ] } 
      ] 
     }); 
    } 
}); 

回答

2

我在類似的情況下得到了同樣的錯誤。

我在Chrome中檢查了格式化的源代碼,發現這是由Format插件嘗試加載CKEDITOR.language對象中的標籤引起的。

原來我沒有en-gb包含在我的構建中,顯然它不會自動回落到直線狀態。添加英文(英國)的建設糾正了這些問題。