原创

ajaxFileUpload 报错jQuery.handleError is not a function

温馨提示:
本文最后更新于 2017年04月27日,已超过 2,830 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

今天用ajaxfileupload上传时,引入jq1.9,然后就报了这个错误,百度了下是说在jq1.4之后,这个文件上传插件就没有更新了,handlerError这个函数在1.4之后就废除了,所以可以直接在插件里增加这个函数

handleError: function( s, xhr, status, e )      {  
        // If a local callback was specified, fire it  
                if ( s.error ) {  
                    s.error.call( s.context || s, xhr, status, e );  
                }  
  
                // Fire the global callback  
                if ( s.global ) {  
                    (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );  
                }  
    }

这样就有用了,当然,你也可以把jq版本换下去.

正文到此结束
本文目录