1. 程式人生 > >ajaxFileUpload :jQuery.handleError is not a function的解決方法

ajaxFileUpload :jQuery.handleError is not a function的解決方法

jQuery.handleError is not a function 報錯原因是:
handlerError只在jquery-1.4.2之前的版本中存在,jquery-1.4.2之後的版本中都沒有這個函數了。
這裡寫圖片描述
解決方法:將下面的程式碼複製進去ajaxFileUpload .js中。

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] ); } },

這裡寫圖片描述