jQuery.form Ajax无刷新上传报错 (jQuery.handleError is not a function) 解决办法
来源:互联网 发布:最近网络怎么了 编辑:程序博客网 时间:2024/04/30 17:00
今天在用ajaxfileupload时firebug报了一个“jQuery.handleError is not a function”的错误。因为在以前使用jQuery.form一直都没有出现过这个问题,我对比以前的项目才发现,在这个项目中使用的jQuery是1.10.2的版本,而以前是使用的1.4.2。度娘一番之后,找到解决办法:jQuery.handleError is not a function 报错原因是:
handlerError只在jquery-1.4.2之前的版本中存在,jquery-1.4.2之后的版本中都没有这个函数了。
因此在jquery高级版本中将这个函数添加上 ,问题解决。 该js代码段可以加在jquer.js或者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.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; } });
0 0
- jQuery.form Ajax无刷新上传报错 (jQuery.handleError is not a function) 解决办法
- jQuery.form Ajax无刷新上传报错 (jQuery.handleError is not a function) 解决办法
- ajaxFileUpload报错jQuery.handleError is not a function
- ajaxFileUpload报错jQuery.handleError is not a function
- ajaxfileupload.js的报错:jQuery.handleError is not a function 解决办法
- jquery ajax图片上传 springmvc ajaxFileUpload 报这错jQuery.handleError is not a function
- AJAX问题:jQuery.handleError is not a function
- ajaxfileupload.js上传文件时jQuery.handleError is not a function的 解决办法
- jQuery.handleError is not a function
- ajaxfileupload.js结合低版本jquery报异常:TypeError: jQuery.handleError is not a function
- ajaxfileupload上传文件dataType为json时报jQuery.handleError is not a function
- ajaxfileupload.js jQuery.handleError is not a function
- ajaxFileUpload 报这错jQuery.handleError is not a function
- ajaxFileUpload :jQuery.handleError is not a function的解决方法
- ajaxFileUpload 报这错jQuery.handleError is not a function
- 【转载】ajaxFileUpload 报这错jQuery.handleError is not a function
- Uncaught TypeError: jQuery.handleError is not a function
- $.handleError is not a function
- 金字塔
- 1
- Android 拍照并显示在ImageView中(进阶)
- 关于字符串组合等地址问题
- HDU -- 4869 Turn the pokers(组合数,费马小定理)
- jQuery.form Ajax无刷新上传报错 (jQuery.handleError is not a function) 解决办法
- 暂时备份(全方位分块仿射变换)
- qemu 修改qcow2 image文件
- POJ--3981:字符串替换
- xtu-1140 Anti-Goldbach's Conjecture
- Unity3D MonoBehaviour Lifecycle
- 常用excel函数实例
- have a look
- 【算法导论学习-25】 二叉树专题3:Treaps