今天在使用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');
});

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2021-09-24
  • 2021-06-19
  • 2021-12-25
  • 2022-12-23
  • 2021-08-28
  • 2021-11-12
相关资源
相似解决方案