Struggling with rich text, kindeditor usage and (JSP) cases-correcting __JS

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.