I'm trying to refresh all my CKEditor instances using this code:
for(name in CKEDITOR.instances)
{
console.log(name);
CKEDITOR.instances[name].destroy();
//Also tried this
//CKEDITOR.instances[name].destroy(true);
}
CKEDITOR.inlineAll();
and I'm receiving this:
Uncaught TypeError: Cannot call method 'getRanges' of null.
The interesting part is that, if I use the code directly in the console, it works just fine.
Anyone has any idea on how to solve it?