AJAXFILEUPLOAD報錯: jQuery.handleError is not a function 解決方法

原因

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] );
        }
    },
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章