CKEditor instance already exists

前端 未结 30 3560
刺人心
刺人心 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:09

    I've had similar issue where we were making several instances of CKeditor for the content loaded via ajax.

    CKEDITOR.remove()

    Kept the DOM in the memory and didn't remove all the bindings.

    CKEDITOR.instance[instance_id].destroy()

    Gave the error i.contentWindow error whenever I create new instance with new data from ajax. But this was only until I figured out that I was destroying the instance after clearing the DOM.

    Use destroy() while the instance & it's DOM is present on the page, then it works perfectly fine.

提交回复
热议问题