类型错误:c[a] 在 CKEditor 中未定义

sha*_*mat 5 javascript jquery ckeditor

我正在使用 $.getScript 加载 ckeditor.js 文件,并在回调中启动 CKEditor。但它显示了一个错误 TypeError: c[a] is undefined。这是我的代码。我该如何解决这个问题?

$.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' ] }
            ]
        });
    }
});
Run Code Online (Sandbox Code Playgroud)

小智 6

在类似的情况下,我遇到了同样的错误。

我检查了 Chrome 中的格式化源,发现这是由 Format 插件试图从CKEDITOR.language对象加载其标签引起的。

事实证明我没有en-gb包含在我的构建中,显然它不会自动回落到直接。将英语(英国)添加到构建中更正了问题。