CKEditor 4 页面多次调用 ,出现多个editor(编辑器),很无语
网上面有好多方法是用remove,其实是没有用的,比如:
if (CKEDITOR.instances[id]){
CKEDITOR.remove(CKEDITOR.instances[id]);
CKEDITOR.replace(id);
}
解决办法:
function LoadCk() {
//加载CKeditor
//判定 Content 是否存在
var editor;
if (!CKEDITOR.instances['content']) {
editor = CKEDITOR.replace('content');
} else {
CKEDITOR.instances.content.destroy();
CKEDITOR.replace('content');
}
}