Download Kindeditor source files on the Web,
I am using the kindEditor4.1.2 version, after the compression of the list of the following figure:
Step 1, delete the asp,asp.net,examples,php file, and copy the three jar packages under the Lib folder in the JSP to Web-inf Lib.
Step 2, create a new editor folder, place the remaining files under the file, and place the file under the project file. If the project name is phone, put it under the phone file.
Step 3, add code to the JSP that needs Rich text
<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 (' textarea[name= ' edit_id "] ', {
Allowfilemanager:true,
Set Editor to Simple mode
Items: [' fontname ', ' fontsize ', ' | ', ' forecolor ', ' hilitecolor ', ' bold ', ' italic ', ' underline ', ' removeformat ', ' | ', ' ju Stifyleft ', ' justifycenter ', ' justifyright ', ' insertorderedlist ', ' insertunorderedlist ', ' | ', ' emoticons ', ' image ', ' Link '],
The following line of code is the key to executing this.sync () when the focus is lost;
Afterblur:function () {
This.sync ();
}
});
});
</script>
Step 4, set the textarea of rich text in the page to the following form
<textarea id= "editor_id" name= "Content" style= "width:700px;height:300px;" ></textarea>
Step 5, the background can be the usual way to get the parameters of the textarea content, the field corresponding to the MySQL field is best set to the text text field.