Swfupload上传在IE9浏览器中问题及解决方案

Swfupload在文件上传方面应用广泛,在升级了自己的本本后发现IE9下Swfupload不能正常显示的问题以及getAttribute出现找不到对象的问题。通过分析,可以通过修改swfobject.js进行解决。
1、不能显示需要修改getflashhtml方法
// Private: getFlashHTML generates the object tag needed to embed the flash in to the document
SWFUpload.prototype.getFlashHTML = function () {
    // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
    var classid = "";
    var Sys = {};
    var ua = navigator.userAgent.toLowerCase();

    if (window.ActiveXObject)
        Sys.ie = ua.match(/msie ([\d.]+)/)[1];
    if (Sys.ie && Sys.ie.substring(0, 1) == "9") {
        classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
    }
        return ['<object id="', this.movieName, '" classid="',classid,'"  type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
                '<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() + '" />',
                '</object>'].join("");
};

2、不能调用getAttribute的问题
SWFUpload.prototype.cleanUp = function ()
try {
if (typeof (movieElement[key]) === "function" && key[0] <= 'Z') {
    movieElement[key] = null;
                    }


文章来自: 本站原创
引用通告地址: http://www.handytech.cn/blog/trackback.asp?tbID=138  后的修改

你可能感兴趣的:(Swfupload上传在IE9浏览器中问题及解决方案)