I can't seem to destroy instances of CKEdit per the documentation.
Consider the following:
<input name="txt1" type="text" id="txt1" /><br /> <a href="javascript:void(0);" onclick="create()">Create</a><br /> <a href="javascript:void(0);" onclick="destroy()">Destroy</a> <script type= "text/javascript" > <!-- function create() { var hEd = CKEDITOR.instances['txt1']; if (hEd) { CKEDITOR.remove(hEd); } hEd = CKEDITOR.replace('txt1'); } function destroy(){ var hEd = CKEDITOR.instances['txt1']; if (hEd) { CKEDITOR.remove(hEd); } } --> </script>
When destroy() runs, CKEDITOR.remove(hEd); is being called. Multiple clicks to create() produce multiple instances of CKEditor on screen, but their instances no longer appear in CKEDITOR.instances.
Am I missing something?
When destroy() runs, CKEDITOR. remove(hEd); is being called. Multiple clicks to create() produce multiple instances of CKEditor on screen, but their instances no longer appear in CKEDITOR.
The CKEditor 4 Find and Replace feature allows for finding and replacing any text in the editor easily. It helps the user find words, word parts or phrases matching the case of the searched text, which is especially helpful in lengthy documents and one that may utilize certain words in different contexts.
If you need to get the actual data from CKEditor at any moment using JavaScript, use the editor. getData() method as described in the next section. When you print the data from the database to a <textarea> element in an HTML page, you need to encode it correctly.
You must use hEd.destroy (editor.destroy()).
CKEDITOR.remove() is for internal use as stated in the API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With