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

解决办法:

//对编辑器的操作最好在编辑器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>

相关文章:

  • 2021-12-30
  • 2021-11-30
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-04
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
相关资源
相似解决方案