码迷,mamicode.com
首页 > 其他好文 > 详细

UpLoadify在IE下兼容问题

时间:2018-08-22 18:27:28      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:settings   memory   ati   mode   useragent   nav   mod   this   query   

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

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

    SWFUpload.prototype.getFlashHTML = function () {  
        // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay  
        var obj = [‘<object id="‘, 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 = [  
    ‘<param name="wmode" value="‘, this.settings.button_window_mode, ‘" />‘,  
    ‘<param name="movie" value="‘, this.settings.flash_url, ‘" />‘,  
    ‘<param name="quality" value="high" />‘,  
    ‘<param name="menu" value="false" />‘,  
    ‘<param name="allowScriptAccess" value="always" />‘,  
    ‘<param name="flashvars" value="‘, this.getFlashVars(), ‘" />‘  
    ].join("");  
        if (navigator.userAgent.search(/MSIE/) > -1) {  
            obj = [‘<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="‘, this.movieName, ‘" width="‘, this.settings.button_width, ‘" height="‘, this.settings.button_height, ‘" class="swfupload">‘].join("");  
            params += ‘<param name="src" value="‘ + this.settings.flash_url + ‘" />‘;  
        }  
        return [obj, params, ‘</object>‘].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) {}
        };
    };

 

UpLoadify在IE下兼容问题

标签:settings   memory   ati   mode   useragent   nav   mod   this   query   

原文地址:https://www.cnblogs.com/chenze-Index/p/9519038.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!