CKEditor 4.7x - 未捕获的SyntaxError:无效的简写属性初始值设定项

时间:2017-12-02 08:49:15

标签: javascript php ckeditor ckeditor4.x

我试图让imageuploader与CKeditor一起工作,我收到以下错误:

Uncaught SyntaxError: Invalid shorthand property initializer load_ckeditor.js

以下是the_ckeditor.js

的内容
CKEDITOR.plugins.addExternal( 
      'imageuploader', 
       '/themes/blog/imageuploader/', 
       'plugin.js' 
);

CKEDITOR.replace( 'editor1',{
    extraPlugins = 'imageuploader'
});

错误行号是指:

extraPlugins = 'imageuploader'

我已根据此处的示例完全复制了代码:https://cdn.ckeditor.com/

当我删除extraPlugins =' imageuploader'时,CKEditor正确加载,但它缺少插件。

1 个答案:

答案 0 :(得分:0)

语法错误,CKEDITOR.replace接受一个对象,因此它需要冒号而不是等号。正确的实施应该是:

CKEDITOR.replace( 'editor1',{
  extraPlugins: 'imageuploader'
});