2 回答
TA贡献1863条经验 获得超2个赞
试试下面的一个,
if($('#reference_sites').length){
$output = "<textarea id='ckeditor-rs' name='ckeditor-rs' rows='10' cols='80'></textarea>";
$('#reference_sites').append($output);
CKEDITOR.replace('ckeditor-rs');
var editor = CKEDITOR.instances['ckeditor-rs'];
editor.setData("{{$proposal->reference_sites}}");
}else{
console.log("couldn't append ckeditor in rs");
}
TA贡献1797条经验 获得超4个赞
您可以尝试以下代码:
if($('#reference_sites').length){
$output = "<textarea id='ckeditor-rs' name='ckeditor-rs' rows='10' cols='80'></textarea>";
$('#reference_sites').append($output);
CKEDITOR.replace('ckeditor-rs');
for (var i in CKEDITOR.instances) {
CKEDITOR.instances[i].on('change', function() {
CKEDITOR.instances[i].updateElement()
});
}
}else{
console.log("couldn't append ckeditor in rs");
}
添加回答
举报