Use of the Nicedit Rich Text Editor in Web projects

Source: Internet
Author: User

Use of the Nicedit Rich Text Editor in Web projects

Why should I use a rich text editor?

First of all, the Rich text editor, the normal HTML input or textarea tags can only be simple input, and do not have other text adjustment function, even

Even the space and carriage return to write another tool class to identify, not to mention the font size and color changes, the overall layout is functional. In fact, the general reading of the type of text input box is required

To Rich text editor, yes, you usually write a blog with a rich text editor. If you still can't understand the difference between rich text and normal input boxes, see:

 

Second, why to choose Nicedit

Similar Rich text editor has many, here choose Nicedit not because it is how good, but it is not comprehensive, it is not very good-looking,

However, it has several great advantages: good compatibility, simple and lightweight, suitable as a background manager of the input box.

Iii. Methods of Use

1. Download the Nicedit toolkit with the following contents in the package

2. Copy the Nicedit.js and niceditoricons.gif files to the Web project and place them in the static resource location

3. Modify the position of Niceditoricons.gif in the project in Nicedit.js

4. In the JSP code is as follows (note to modify the path of JS):

5. Get the value of the rich text input, note that here with TEXTAREA ID and value is not get, because Nicedit will hide the original textarea, and generate the input box, which is to get inside the box

The text needs to be obtained by its generated class name, and the code is implemented as follows:

I am here to facilitate the direct submission of the form, the button event triggered directly to the rich text in the value obtained, and assigned to the form of the hidden input.

Here Nicedit Rich Text can achieve the purpose of use, the need for a file only a JS file and a picture, is not really very light is very simple? So, in just a simple text editing function

, consider using this rich text editor. Share finished, thank you for reading.

Use of the Nicedit Rich Text Editor in Web projects

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.