How to add data to CKEditor using JQuery

后端 未结 7 1972
无人及你
无人及你 2020-12-07 20:33

Everytime a page loads I need to load text into the CK Editor using JQuery, in order to get data from CK Editor I use

var editor_data = CKEDITOR.instances[\'         


        
7条回答
  •  萌比男神i
    2020-12-07 21:19

    From my experience using inside a function sometimes doesn't work properly. I'll suggest to use in:

        $(document).ready(function () {
        ...
        // instance, using default configuration.
        CKEDITOR.replace('editor1');
        //set data
        CKEDITOR.instances['editor1'].setData(data);
        ...
        });
    

提交回复
热议问题