欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

[转载]UEditor报错TypeError: me.body is undefined

发布时间:2023/11/30 编程问答 39 豆豆
生活随笔 收集整理的这篇文章主要介绍了 [转载]UEditor报错TypeError: me.body is undefined 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

本文转载来自: 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'); });

 

方法二:

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

 

转载于:https://www.cnblogs.com/towerking/p/4581331.html

总结

以上是生活随笔为你收集整理的[转载]UEditor报错TypeError: me.body is undefined的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。