WangEditor2 version upload image successful echo failure processing

Source: Internet
Author: User

Use WangEditor2 to do text editor primarily for business people to upload pictures

The back of the business staff to reflect the image upload pictures no way to display

The first judgment is that the upload error causes the picture echo to fail
View IP discovery has the OnLoad method, after the call found write this method will be the original overall coverage and I just need to increase the failure prompt

Then add a bit of code under the ONLOADF method to send a function to make your own request prompt

Fns.myonload&&fns.myonload (Resulttext)

Then the business people will reflect the problem of the main operation first upload 9 pictures deleted after the addition of 7 will not be displayed

_wangeditoruploadfiles.length=9 was found by print test; Is that the previous value should be the cause of this

if (_wangeditoruploadfileindexok = = _wangeditoruploadfiles.length) {                        editor.command (null, ' Inserthtml ', _wangeditoruploadfilehtmls.join ('));                    }

and find the definition of the variable.

 for (var _i = 0;_i<files.length;_i++) {            = files[_i];        }

Uploading again without initializing the value of the variable

_wangeditoruploadfiles=[];
So just initialize it before this for.

WangEditor2 version upload image successful echo failure processing

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.