首页 > 其他 > 详细

使用UEditor 报错Cannot read property 'nodeType' of undefined 解决办法

时间:2019-12-01 16:04:12      阅读:242      评论:0      收藏:0      [点我收藏+]

报如下错误
技术分享图片

解决办法:

//对编辑器的操作最好在编辑器ready之后再做
ue.ready(function() {
})
<!-- 实例化编辑器 -->
<script type="text/javascript">
$(function(){
     var ue = UE.getEditor("container",{
                autoHeight: false
     });
     /对编辑器的操作最好在编辑器ready之后再做
     ue.ready(function() {
         //设置编辑器的内容
         ue.setContent('hello');
         //获取html内容,返回: <p>hello</p>
         var html = ue.getContent();
         alert(html)
         //获取纯文本内容,返回: hello
         var txt = ue.getContentTxt();
         alert(txt);
    });
});
</script>

使用UEditor 报错Cannot read property 'nodeType' of undefined 解决办法

原文:https://www.cnblogs.com/linhuaming/p/11966247.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!