CKEditor instance already exists

前端 未结 30 3474
刺人心
刺人心 2020-11-27 11:24

I am using jquery dialogs to present forms (fetched via AJAX). On some forms I am using a CKEditor for the textareas. The editor displays fine on the first load.

Whe

30条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 12:13

    This functions works for me in CKEditor version 4.4.5, it does not have any memory leaks

     function CKEditor_Render(CkEditor_id) {
            var instance = CKEDITOR.instances[CkEditor_id];
            if (CKEDITOR.instances.instance) {
                CKEDITOR.instances.instance.destroy();
            }
            CKEDITOR.replace(CkEditor_id);
        }
    

    // call this function as below

    var id = 'ckeditor'; // Id of your textarea
    
    CKEditor_Render(id);
    

提交回复
热议问题