使用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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM