ueditor UEditor的setContent的时候报错


今天在使用UEditor的setContent的时候报错,报错代码如下

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

ueditor.addListener("ready", function () {
ueditor.setContent('UEditor报错TypeError: me.body is undefined');
});

方法二:

ueditor.ready(function() {
ueditor.setContent('UEditor报错TypeError: me.body is undefined');
});


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM