原因
handerError 只在jq 1.4.2 之前有,之後的版本都沒有這個函數。
解決方法
將handler函數加到ajaxfileupload中。
即紅框中的部分。
代碼如下
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] );
}
},