Today, when using Ajaxfileupload, Firebug reported a "jquery.handleerror is not a function" error. Since the previous use of Jquery.form has not been the problem, I compared to the previous project to find that the use of jquery in this project is a 1.10.2 version, and used to use the 1.4.2. After a few Niang, to find a solution: Jquery.handleerror is not a function error causes are:
Handlererror only existed in the previous version of jquery-1.4.2, and the function was not available in the jquery-1.4.2 version.
So adding this function to the jquery advanced version solves the problem. The JS code snippet can be added to the Jquer.js or ajaxfileupload.js.
;
(function ($) {Jquery.extend ({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]); }, Httpdata:function (XHR, type, s) {var ct = xhr.getrespons Eheader ("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; }
});
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/ajax/