Home > Web Front-end > JS Tutorial > How to successfully use Baidu Rich Text from downloading to running

How to successfully use Baidu Rich Text from downloading to running

一个新手
Release: 2017-09-27 10:37:18
Original
1711 people have browsed it

1: I won’t talk about downloading. Let’s go directly to the usage topic. The package we downloaded from the Internet is jsp.
How to successfully use Baidu Rich Text from downloading to running
2: Then import the package into the maven project. (The requirement is the entire package content after downloading)
How to successfully use Baidu Rich Text from downloading to running
3: Since Ueditor needs jar package support when using it, put the jar package under ueditor\jsp\lib under WEB-INF /lib , and then reference these jar packages in the project, as shown in the figure:

How to successfully use Baidu Rich Text from downloading to running
How to successfully use Baidu Rich Text from downloading to running
4: After the jar package is ready, start introducing ueditor
How to successfully use Baidu Rich Text from downloading to running
5: Next is the method request path for content input and image upload. This is also a time when there are many pitfalls. Here we only talk about the path and echo of image upload.
Rewrite the ueditord path in the corresponding jsp.

UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
    UE.Editor.prototype.getActionUrl = function(action) {
        if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage' || action=='uploadvideo') {
            return "${imageServer }/front/person/uploadProjectDetailImg.htm";
        } else if (action == 'uploadvideo') {
            return 'http://a.b.com/video.php';
        } else {
            return this._bkGetActionUrl.call(this, action);
        }
    }
    UE.Editor.prototype._bkGetContentLength = UE.Editor.prototype.getContentLength;
    UE.Editor.prototype.getContentLength = function(){
        return this.getContent().length;
    }
Copy after login

After the upload is successful, the fields required for the ueditor's image echo are state:success, url: your path. Therefore, after the action execution is completed, a json format string needs to be returned so that the image can be normal. Echo, other pitfalls can be slowly understood and learned through Baidu. I will learn this first here, thank you!

The above is the detailed content of How to successfully use Baidu Rich Text from downloading to running. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template