CKEditor instance already exists

前端 未结 30 3548
刺人心
刺人心 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 11:52

    i had the same problem with instances, i was looking everywhere and finally this implementation works for me:

    
    
        //set my instance id on a variable
    
        myinstance = CKEDITOR.instances['info'];
    
        //check if my instance already exist
    
        if (myinstance) { 
            CKEDITOR.remove(info)
        }
    
        //call ckeditor again
    
        $('#info').ckeditor({
            toolbar: 'Basic',
            entities: false,
            basicEntities: false
        });
    
    

提交回复
热议问题