Jquery uploadify 多余的Get请求(404错误)的解决方法

在使用jquery uploadify时如果不设置button_image_url参数,就会出现一些多余的get请求,甚至报404的错误,这是该插件的一个bug,官方给出的解决方案如下:

找到如下代码:

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

相关推荐