博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
富文本,KindEditor的使用方法及(jsp)案例
阅读量:4672 次
发布时间:2019-06-09

本文共 938 字,大约阅读时间需要 3 分钟。

在网上下载KindEditor源文件,

我用的是kindEditor4.1.2版本,加压缩后目录如下图:

 

步骤1、将asp,asp.net,examples,php文件删除,同时将jsp中的lib文件夹下的三个jar包拷贝到WEB-INF的lib下。

步骤2、新建一个editor文件夹,将剩余的文件放到该文件下面,同时将该文件放到项目文件下面。如项目名为phone则放在phone文件下。

步骤3、在需要富文本的jsp中加入一下代码

          <script charset="utf-8" src="http://www.cnblogs.com/http://www.cnblogs.com/editor/kindeditor.js"></script>

     <script charset="utf-8" src="http://www.cnblogs.com/http://www.cnblogs.com/editor/lang/zh_CN.js"></script>
     <script>
           var editor;
           KindEditor.ready(function(K) {
                   editor = K.create('#editor_id');
           });
           var options = {
            cssPath : '/css/index.css',
            filterMode : true
        };
       var editor = K.create('textarea[name="content"]', options);
     </script>

步骤4、将页面中需要富文本的textarea设置成如下形式

         <textarea id="editor_id" name="content" style="width:700px;height:300px;"></textarea> 

步骤5、后台就可以按着平常的获取参数的方法获取textarea的内容,该字段对应的mysql中的字段最好设置成text文本字段。

 

转载于:https://www.cnblogs.com/lcgw/archive/2012/09/24/KindEditor.html

你可能感兴趣的文章
HDOJ 4734 数位DP
查看>>
我的第一个python web开发框架(15)——公司介绍编辑功能
查看>>
win10
查看>>
JS DOM操作基础
查看>>
DataSet.GetBookMark内存泄漏
查看>>
get请求中params参数的使用
查看>>
[LeetCode] 617. Merge Two Binary Trees
查看>>
[LeetCode] 538. Convert BST to Greater Tree
查看>>
Django中的form模块的高级处理
查看>>
[js]DOM 篇
查看>>
C# 观察者模式
查看>>
SQLite(二)高级操作
查看>>
iOS开发之oc(二十)--Foundation(5)NSDictionary
查看>>
初入RFID技术
查看>>
电暖器选购指南(包括暖风机)
查看>>
各类常犯的错误总结
查看>>
mac打包python3程序
查看>>
Manacher's algorithm: 最长回文子串算法
查看>>
算法题003 斐波那契(Fibonacci)数列
查看>>
MySQL索引背后的数据结构及算法原理
查看>>