jsp中如何使用Ueditor


在jsp頁面中類似word編輯器操作textarea

 

使用步驟:

step1、官網下載Ueditor  http://ueditor.baidu.com/website/download.html

step2、jsp頁面引入Ueditor的js文件

   <script type="text/javascript" src="ueditor/ueditor.config.js"></script>(配置文件)

   <script type="text/javascript" src="ueditor/ueditor.all.js"></script>(編輯器源碼文件)

step3、新建textarea標簽,如下所示

<textarea id="container" name="container" style="width: 800px; height: 400px; margin: 0 auto;"> </textarea>

step4、實例化編輯器  即把textarea替換為Ueditor編輯器

      <script type="text/javascript">

       var ue = UE.getEditor("container");

setTimeout(function(){editor.execCommand('drafts')},2000);//自動保存

      </script>

 


免責聲明!

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



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