search
Homephp教程php手册Ueditor独立图片上传的一个BUG的解决

之前用到了Ueditor官网上面的ueditor for thinkphp 3.2插件,之后整合进自己的项目,在使用单独图片上传时发现了侦听事件不起作用。找了度娘,大家都有这个问题,去看了官方文档,最终解决了问题,分享给大家。
之前用到了Ueditor官网上面的ueditor for thinkphp 3.2插件,之后整合进自己的项目,在使用单独图片上传时发现了侦听事件不起作用。
找了度娘,大家都有这个问题,去看了官方文档,最终解决了问题,分享给大家。
先上问题截图
Ueditor独立图片上传的一个BUG的解决
再上官方文档
Ueditor独立图片上传的一个BUG的解决
SO,给多图上传模块加上例外就可以使用了。//---上传首图开始---<br> var _editor;<br> $(function() {<br>    //重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件<br>     _editor = UE.getEditor('upload_ue', {<br>         serverUrl :'/Home/Index/ueditor.html',<br>      });<br>     _editor.ready(function () {<br>         //设置编辑器不可用<br>         _editor.setDisabled('insertimage'); <br>         //隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏<br>         _editor.hide();<br>         //侦听图片上传<br>         _editor.addListener('beforeInsertImage', function (t, arg) {<br>             $("#picture").attr("value", arg[0].src);<br>             //图片预览<br>             $(".form-post .pic-show").show();<br>             $("#preview").attr("src", arg[0].src);<br>         })<br>     });<br> });  

AD:真正免费,域名+虚机+企业邮箱=0元

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool