Remove all CKEditor instances

我与影子孤独终老i 提交于 2020-01-01 01:25:24

问题


I have a form in which I have CKEditor replacing my <textarea>s (multiple). I want to remove all CKEditor instances from the page before submitting the form. How can I accomplish this?

I've looked at Remove CKEdit Instance but it didn't help me at all.

NOTE: All my CKEditors have a class "ckedit"


回答1:


This will destroy all CKEDITOR instances on a page:

for(name in CKEDITOR.instances)
{
    CKEDITOR.instances[name].destroy(true);
}



回答2:


you can make use of .remove() of jquery, before submitting.




回答3:


Have you tried just...

delete CKEDITOR;

I had a similar situation and this worked for me. Just make sure you re-create it the next time you need to use it. Otherwise try keeping an array of id's of all the instances you create and just loop through that array and destroy them all.



来源:https://stackoverflow.com/questions/11687627/remove-all-ckeditor-instances

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!