4
votes

I know there are similar question on stackoverflow or google, but nothing helps so far.. I use ckeditor with jquery adapter in leatest stable version.

After clicking back and forward i got following error in firebug:

uncaught exception: [CKEDITOR.editor] The instance "cause" already exists

when i now try to destroy the editor by:

var editor=jQuery("#cause").ckeditorGet();
editor.destroy();

i got following error:

CKEditor not yet initialized, use ckeditor() with callback.

If i try to reproduce the issue step by step (except the back/forward button) i got some different behavior in firebug

create a new ckeditor

jQuery('#cause').ckeditor();

destroy the editor again

var editor=jQuery('#cause').ckeditorGet();
editor.destroy();

try to recreate the editor fails (without any warning or error)

jQuery('#cause').ckeditor();

result: the textarea stays

expected result: the editor come up again

any help would be appreciated

1
hmm for some strange reasons i cannot reproduce my problem anymore... yust want let you know that delete CKEDITOR.instances.cause; fixed my issue - nfo
related post to any others who come here stackoverflow.com/questions/1794219/… - Kevin
You can check a live example here stackoverflow.com/questions/48902441/… - samuelj90

1 Answers

4
votes

I found that it crashes if it has not already been initialised before hand. However this works.

Destroy the instance. (assuming that you have a global called CKEDITOR.

if(CKEDITOR){
    if(CKEDITOR.instances.editor1){
        CKEDITOR.instances.editor1.destroy();
    }
}