jquery.form附件上传的 $.handleError 、以及 $.httpData

jquery.form.js上传出现$.handleError  、以及  $.httpData

 原因:

    首先,jquery1.4以后的版本不在支持这两个方法。

 解决方法:

  添加

1、httpData:function( xhr, type, s ) { var ct = xhr.getResponseHeader( "content-type"), xml = type == "xml" || !type && ct && ct.indexOf( "xml" ) >=0, data = xml ? xhr.responseXML: xhr.responseText; if ( xml && data.documentElement.tagName == "parsererror" )
throw "parsererror" ; if ( s && s.dataFilter ) data = s.dataFilter( data, type );if ( typeof data === "string" ){if ( type == "script" ) jQuery.globalEval( data ); if ( type == "json" )
data = window[ "eval" ]( "(" + data + ")" ); } return data; },
2、handleError: function (s, xhr, status, e) { if (s.error) { s.error.call(s.context || s, xhr, status, e); }if (s.global) {(s.context ? jQuery(s.context) : jQuery.event).trigger("ajaxError", [xhr, s, e]); } }这两个函数


你可能感兴趣的:(jquery.form,$.handleError,$.httpData)