ajax 给 ueditor赋值报错解决办法

时间:2020-07-11 16:43:37 类型:JS/JQUERY
字号:    


TypeError: me.body is undefined 或 Uncaught TypeError: Cannot set property 'innerHTML' of undefined 错误的原因是没有等UEditor创建完成就使用UEditor的setContent函数了,可以通过如下代码解决 


方法一:

ueditor.addListener("ready", function () {

ueditor.setContent('初始值');

});


方法二:

ueditor.ready(function() {

ueditor.setContent('初始值');

});


QQ截图20200711164152.jpg


<