UEditor study notes (2)

UEditor is a WYSIWYG rich text web editor developed by Baidu web front-end R&D department. (Advantages) It is lightweight, customizable, and focuses on user experience. The open source is based on the MIT protocol, allowing free use and modification of the code.

Editor form ( text ) submission

    In the last issue, we first learned about the UEditor rich text editor. In this issue, we will learn about text submission.

1. Modify the jsp file and put the editor in the form

1.       Build the framework ( omitted ) (using the SSM framework)

2. The       received data is displayed as follows :

The data received by ordinary form submission is with tag elements . The following is a demo submitted with ajax

Ajax uses the method provided by UEditor itself

Editor.getplainTxt(): Get the plain text content in the editor , without paragraph formatting ;

The received data is the same as above , and the ajax submission also has tag elements ; this is all because of the security mechanism.

6. Editor's image upload

Click to select the image to upload , select upload ,

Note : Pay attention to the configuration file here :

ImageUrlPrefix: refers to the root path of the project or the root directory of the folder where the image is to be saved

ImagePathFormat: refers to the path to save the image

Because UEditor belongs to online upload , you don't need to configure any upload related ...

Example :

Here we have finished learning the basic operations of UEditor ...

                    Summarize

UEditor provides us with very powerful functions , such as video upload , multi-group image upload, etc. After 1.2.4 , the configuration file has become a highlight , and it is also a difficult point . Mastering the configuration file makes UEditor easy to use . Others For knowledge points , please check the documentation and API on the official website !


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325707338&siteId=291194637