Home > Web Front-end > JS Tutorial > TinyMCE adds local image upload function_jquery

TinyMCE adds local image upload function_jquery

WBOY
Release: 2016-05-16 18:17:07
Original
1181 people have browsed it

In this way, TinyMCE can display pictures normally. In fact, this function belongs to the basic functions of ordinary HTML rich text controls. Existing requirements extend TinyMCE to directly upload local images and then display the images in the text area.
Implementation ideas:
Use Ajax to upload images. This upload method can implement TinyMCE's image upload extension in a more friendly way.
For specific methods, please refer to my previous articleJquery ajaxsubmit to upload images. Integrate Ajax uploaded images into TinyMCE.
Mainly modify the advimage plug-in of tinymcejscriptstiny_mceplugins in the TinyMCE directory.
Those who know TinyMCE should know that TinyMCE is similar to FireFox. Developers can write plug-ins that suit their own needs.
So just modify the advimage plugin slightly. We add jquery image asynchronous submission code for image.htm in the advimage
directory:

Copy the code The code is as follows:



Of course, the input type="file" of flUpload needs to be wrapped in the form html tag and the

method=" post" enctype="multipart/form-data" action=url attribute.
The screenshot of the program is as follows:
TinyMCE adds local image upload function_jquery
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