主题: jQuery异步调用KindEditor无法赋值【解决】

 1 KindEditor.ready(function (K) {
 2 window.editor1 = K.create('#tjssjs', {
 3  '480px',
 4 height: '150px',
 5 afterBlur: function () { this.sync(); }
 6 });
 7 window.editor2 = K.create('#xgssjs', {
 8  '480px',
 9 height: '150px',
10 afterBlur: function () { this.sync(); }
11 });
12 });

异步过程中:editor2.html(data.yhnr);
success: function(data) {
    //txtIntroduce为textarea文本框ID,当async: false时赋值后可以正常显示,但设为true时显示不了 
    //使用KE.html(id,value)、editor.html(id,value)等方法都不行,也尝试过不用textarea的ID,用 
    //该控件的kindeditor对象赋值也不行,显示不了。 
    // editor 为KindEditor对象
    editor.html(data.Introduce);
    //$("#txtIntroduce").val(data.Introduce);
}

  


 
原文地址:https://www.cnblogs.com/h5monkey/p/5959573.html