在jsp页面中类似word编辑器操作textarea

 jsp中如何使用Ueditor

使用步骤:

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 > </textarea>

step4、实例化编辑器  即把textarea替换为Ueditor编辑器

      <script type="text/javascript">

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

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

      </script>

 

相关文章:

  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2021-09-16
  • 2021-06-15
  • 2021-08-11
  • 2021-08-03
猜你喜欢
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案