我正在尝试使用此代码刷新我所有的 CKEditor 实例:
for(name in CKEDITOR.instances)
{
console.log(name);
CKEDITOR.instances[name].destroy();
//Also tried this
//CKEDITOR.instances[name].destroy(true);
}
CKEDITOR.inlineAll();
我收到了这个:
Uncaught TypeError: Cannot call method 'getRanges' of null.
有趣的是,如果我直接在控制台中使用代码,它工作得很好。
有人知道如何解决吗?
最佳答案
查看此错误报告:http://dev.ckeditor.com/ticket/10219
在 4.1 和 4.0.3 中,我们已经部分修复了这个问题,但是......只是部分:)。但是,此错误不会造成任何问题 - 它是完全无害的。
关于javascript - 无法销毁 CKEditor 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15584841/