How to add data to CKEditor using JQuery

后端 未结 7 1987
无人及你
无人及你 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条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 21:27

    var jqxhr = $.get( "file.php", function(data) {
    CKEDITOR.instances.idOftextAreaName.setData( data );
        alert( "success" );
      })
    .done(function() {
        //alert( "second success" );
    })
    .fail(function() {
        alert( "error" );
    })
    .always(function() {
       // alert( "finished" );
    });
    

提交回复
热议问题