Having added the CKEditor successfully to our web application, we see that it loads fine but during post-back we get a javascript error message as
uncaught exception: [CKEDITOR.editor] The instance "myCKEditor" already exists.
The error states about the existence of the CKEditor in the browser. So, we have to get rid of the ones that already exists using the following method:
<script language="javascript" type="text/javascript">
if (CKEDITOR.instances['myCKEditor']) { delete CKEDITOR.instances['myCKEditor'] };
if (CKEDITOR.instances['myCKEditor']) { CKEDITOR.instances['myCKEditor'].destroy(); }
</script>
The above code will remove the existence of the ‘myCKEditor’ editor from the browser memory and recreates it thereby resolving the issue.
Happy Programming!!!
5 comments:
Hi!
I'm fighting with the same problem, and i'm stucked. In which part of the code did you put this fragment?
I tried it serveral ways but didn't worked.
Any help would be good.
Thanks.
Ggy
Hi Gabor,
Just add the above script fragment at the bottom of your page where you are using the CKEditor control. I know you might have changed the CKEditor instance name 'myCKEditor' in the above script matching with yours but just curious and wanted you double check just to make sure you have done that.
Thanks,
Hemant.
Works great! thanks!!!
RE.
Glad to help you.
Thanks & Regards,
Hemant.
i love you man <3
Post a Comment