Angularjs use of uploadify plug-in problem summary

Source: Internet
Author: User

Angularjs The use of uploadify in the process encountered two problems, summarized as follows:

    • When a page needs to instantiate multiple uploadify components at the same time, the "ID Swfupload_0 is already in use" appears. The Flash Object could not being added "error, Analysis of Jquery.uploadify.js code discovery, is due to be instantiated swfuload with the same name, the solution is: Find Initswfuploadify, modify the following (red part):
SWFUpload.prototype.initSWFUpload =function(b) {Try {         This. customsettings = {}, This. Settings = B, This. EventQueue = [];var mydate = new Date ();  This. Moviename = "Swfupload_" +mydate.gettime (). toString (), This. movieelement =NULL, swfupload.instances[ This. moviename] = This, This. Initsettings (), This. Loadflash (), This. Displaydebuginfo (); } Catch(a) {Throw Deleteswfupload.instances[ This. Moviename], A; }
    • IE8/9 appear ui-router can't jump page, address bar URL changed, but the page has not changed, error message:

SCRIPT5007: Cannot set value for property ' setbuttontextpadding ': object is null or undefined
SCRIPT5007: Cannot set value for property ' Setbuttontextstyle ': object is null or undefined
SCRIPT5007: Cannot set value for property ' Setbuttonaction ': object is null or undefined
SCRIPT5007: Cannot set value for property ' setbuttondisabled ': object is null or undefined
SCRIPT5007: Cannot set value for property ' Setbuttoncursor ': object is null or undefined
SCRIPT5007: Cannot set value for property ' Testexternalinterface ': object is null or undefined
SCRIPT5007: Could not get value for property ' Setreturnvalue ': object is null or undefined
SCRIPT5007: Could not get value for property ' Setreturnvalue ': object is null or undefined

This is due to the fact that the uploadify instance object was not destroyed when switching routes, and the workaround is as follows:

Trigger event at start of State switch, destroy Uploadify object
function (E, ToState, Toparams, FromState, fromparams) { if (E && $ ('. Uploadify '). length > 0 { $ ('. Uploadify '). Each (thefunction (item) { $ (this). Uploadify (' Destroy ') ); }) } });

Reference: http://blog.csdn.net/zhichao2001/article/details/46662705/

Angularjs use of uploadify plug-in problem summary

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.