百度富文本编辑器 UEditor 1.4.3 getContent会报错:Uncaught TypeError

    xiaoxiao2021-04-17  53

    使用UEditor的setContent的时候报错,报错代码如下 Uncaught TypeError: Cannot set property 'innerHTML' of undefined 错:http://blog.csdn.net/u011117571/article/details/45167039

    原因是没有等UEditor创建完成就使用UEditor的setContent函数了,可以通过如下代码解决: 方法一:

    var ue = UE.getEditor('editor'); ue.addListener("ready", function () { alert(ue.getContenet()); });

    方法二:

    var ue = UE.getEditor('editor'); ue.ready(function() { alert(ue.getContent()); });

    转载请注明原文地址: https://ju.6miu.com/read-674380.html

    最新回复(0)