1.环境:tomcat
2.需要外部jar包:
1
2
3
|
commons-fileupload- 1.2 . 1 .jar
commons-io- 1.4 .jar
json_simple- 1.1 .jar
|
3.下载Kindeditor至项目任意目录中,如:/editor
4.Kindeditor引用方式如下:
1
2
3
4
5
6
7
8
9
10
|
一、html代码,创建一个textarea标签: <textarea id= "content_1"
name= "content"
style= "width:700px;height:300px;" ></textarea>
二、引用js文件,并在本页面中利用js进行Kindeditor绑定: <script type= "text/javascript"
charset= "utf-8"
src= "/editor/kindeditor.js" ></script>
<script type= "text/javascript" >
KE.show({
id : ‘content_1‘
//TEXTAREA输入框的ID
});
</script> |
5.如何获取Kindeditor中的内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
一、 1 .在<textarea id= "content_1"
name= "content"
style= "width:700px;height:300px;" ></textarea>
后面添加隐藏input和button,代码如下: <input id= "content_1_1"
type= "hidden"
runat= "server"
value= "" />
<asp:Button ID= "Button1"
runat= "server"
Text= "保存"
OnClientClick= "save();"
OnClick= "Button1_Click"
CssClass= "i_1"
/>
二、添加javascript事件处理代码,代码如下: function save() { var s = KE.util.getData( "content_1" );
s = KE.util.escape(s);
document.getElementById( "content_1_1" ).value = s;
} 三、服务器端 提交时,提交content_1_1的内容即可,然后在服务器端处理content_1_1的内容 |