Uploadify在IE下的兼容问题解决

转载自:https://blog.csdn.net/phy201106/article/details/71774598

哈哈,请跳转至原作者网址上查看问题解决思路,因为本人还不知道要怎么把代码中的文本改成红色的

一、在IE9、IE10不能点击的问题解决

解决方法:进入uploadify的js文件中,搜索SWFUpload.prototype.getFlashHTML,找到它对应的语句,将方法全部替换为以下内容:

    SWFUpload.prototype.getFlashHTML = function () {  
        // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay  
        var obj = [', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">'].join(""),  
    params = [  
    ', this.settings.button_window_mode, '" />',  
    ', this.settings.flash_url, '" />',  
    '',  
    '',  
    '',  
    ', this.getFlashVars(), '" />'  
    ].join("");  
        if (navigator.userAgent.search(/MSIE/) > -1) {  
            obj = [', this.movieName, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">'].join("");  
            params += '+ this.settings.flash_url + '" />';  
        }  
        return [obj, params, ''].join("");  
    };  
 
  

二、JQuery运行时错误:“没有对象”

解决方法:进入uploadify的js文件中,搜索SWFUpload.prototype.cleanUp ,找到它对应的语句,在方法中对应的位置添加红色部分内容

  SWFUpload.prototype.cleanUp = function(f) {
        try {
            if (this.movieElement && typeof(f.CallFunction) === "unknown") {
                this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
                for (var h in f) {
                    try {
                        if (typeof(f[h]) === "function" && h[0] >= 'A' && h[0] <= 'Z') {
                            f[h] = null;
                        }
                    } catch(e) {
    }
                }
            }
        } catch(g) {
    }
        window.__flash__removeCallback = function(c, b) {
            try {
                if (c) {
                    c[b] = null;
                }
            } catch(a) {}
        };
    };

你可能感兴趣的:(报错及解决)