在JSP中使用CKEditor网页编辑器

为了在我的一个项目使用CKEditor网页编辑器,我开始了寻找应用之法。

我下载了ckeditor_4.3.3_standard和ckeditor-java-core-3.5.3。

之前的版本和现在版本的使用好像不一样。

参考了《HTML编辑器FCKeditor使用详解》:

其版本是“FCKeditor 2.5.1(FCKeditor_2.5.1.zip)和FCKeditor.Java(FCKeditor-2.3.zip)”

发现不能使用。

然后我直接找到“http://nightly.ckeditor.com/14-04-02-06-05/standard/samples/”官方网站的使用说明。

其实ckeditor 4.0以后的编辑器使用javascript来写,可直接使用。

使用<script src="/ckeditor/ckeditor.js"></script>导入保存在根目录下的/ckeditor/ckeditor.js脚本,

然后在页面上使用如下代码即可(一定要使用class为ckeditor):

<textarea class="ckeditor" name="editor1"></textarea>
还可以使用Id:
<textarea cols="80" id="editor1" name="editor1" rows="10">
   
  </textarea>
  <script>
   
  // This call can be placed at any point after the
  // <textarea>, or inside a <head><script> in a
  // window.onload event handler.
   
  // Replace the <textarea id="editor"> with an CKEditor
  // instance, using default configurations.
   
  CKEDITOR.replace( ‘editor1‘ );
   
  </script>

在JSP中使用CKEditor网页编辑器,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。