页面中富文本的使用

1、引包

<script>window.UEDITOR_HOME_URL = "${base}/common/ueditor/";script> 
<script type="text/javascript" src="${base}/common/js/jquery.form.min.js" >script>
<script type="text/javascript" charset="utf-8" src="${base}/common/ueditor/ueditor.config.js">script>
<script type="text/javascript" charset="utf-8" src="${base}/common/ueditor/ueditor.all.js">script>
<script type="text/javascript" charset="utf-8" src="${base}/common/ueditor/contentblocks.js">script>

2、页面中引用

 <div class="editer">
       <script  id="editor" type="text/plain" name="" value="" style="height:300px;width:520px">script>      
  div>

3、js加载

$(document).ready(function(){
    
    editor = new UE.ui.Editor();
    editor.render("editor");
    editor.ready(function(){
      updateParentIframeHeight();
      
    })     
    


});

4、获得富文本中内容

var text =   UE.getEditor('editor').getContentTxt();

 

你可能感兴趣的:(页面中富文本的使用)