我试图让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正确加载,但它缺少插件。
答案 0 :(得分:0)
语法错误,CKEDITOR.replace
接受一个对象,因此它需要冒号而不是等号。正确的实施应该是:
CKEDITOR.replace( 'editor1',{
extraPlugins: 'imageuploader'
});