编程那点事编程那点事

专注编程入门及提高
探究程序员职业规划之道!

UEditor报错TypeError: me.body is undefined

今天在使用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',2);
},2);
方法二:
ueditor.ready(function() {
ueditor.setContent('UEditor报错TypeError: me.body is undefined',2);
},2);
未经允许不得转载: 技术文章 » javascript » UEditor报错TypeError: me.body is undefined