uploadify各种问题解决

来源:互联网 发布:网络直播公司老板跑路 编辑:程序博客网 时间:2024/06/05 22:31

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

修改jquery.uploadify.min.js中大概877行左右的"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("");};

二、上传完成后,点击删除不能触发"onCancel"方法解决

'onUploadSuccess' : function(file, data, response) {      var cancel=$("#"+file.id + " .cancel a");    if (cancel) {        cancel.click(function(){<span style="white-space:pre"></span>$(this).hide();<span style="white-space:pre"></span>if(window.console){<span style="white-space:pre"></span>console.log(data);<span style="white-space:pre"></span>}<span style="white-space:pre"></span>});    });    } },

三、初始化时,自动请求一次URL的问题

修改uploadify的js文件,修改方式如下:

把原来的this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);  this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url)
改为:this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);  this.settings.button_image_url = this.settings.button_image_url ?  SWFUpload.completeURL(this.settings.button_image_url) :   this.settings.button_image_url


0 0
原创粉丝点击