使用ajaxfileupload插件提示Uncaught TypeError:has no method 'handleError'
来源:互联网 发布:繁体转简体软件 编辑:程序博客网 时间:2024/06/06 01:12
最近使用ajaxfileupload插件上传文件时,后台正常运行时,可以正常使用;当后台出现异常时,上传后没有任何反应,也无任何返回信息,使用chrome查看时,发现ajaxfileupload插件报错,信息如下:"Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'handleError'"。
经过在网上搜索答案,发现是由于JQuery在1.5版本后就废除了handleError方法,因此需要在ajaxfileupload中自己添加handleError方法,方法如下:
handleError: function( s, xhr, status, e ) { // If a local callback was specified, fire it if ( s.error ) { s.error.call( s.context || window, xhr, status, e ); } // Fire the global callback if ( s.global ) { (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] ); }}
增加handleError方法后,上传正常,后台发生异常时,可正常捕捉错误进行响应。
- 使用ajaxfileupload插件提示Uncaught TypeError:has no method 'handleError'
- 用 ajaxFileUpload 出现的问题:has no method 'handleError'、返回json数据提示下载
- 用 ajaxFileUpload 出现的问题:has no method 'handleError'、返回json数据提示下载 、一直返回error
- Uncaught TypeError: Object #<Object> has no method 'addEvents'
- Uncaught TypeError: Object #<Object> has no method 'addEvents'
- Uncaught TypeError: Object [object Object] has no method 'live'
- ztree “Uncaught TypeError: Object # has no method 'toLowerCase'”
- Uncaught TypeError: Object #<HTMLDivElement> has no method 'attr'
- Uncaught TypeError: Object #<Document> has no method 'load'
- jquery: Uncaught TypeError: Object [object Object] has no method 'live'
- Uncaught TypeError: Object [object Object] has no method 'xxx'
- Uncaught TypeError: Object [object Object] has no method 'highcharts'
- Uncaught TypeError: Object #<HTMLCollection> has no method 'toLowerCase'问题
- 当使用JQuery的"$",抛异常Uncaught TypeError: Object #<Object> has no method 'ajax'
- Uncaught TypeError: Object #<Object> has no method 'addEvents' ext-all-debug异常
- jquery dialog异常 Uncaught TypeError: Object [object Object] has no method 'dialog'
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- sencha touch中出现JS错误Uncaught TypeError: Object [object Object] has no method 'getForm'
- 解决cpsid_82829s1: "A restart is pending," bootstrapper error has occurred.
- cocos2d-X 节点(CCArmature.h)API
- iOS 网络 NSURL 2
- Android 基于google Zxing实现对手机中的二维码进行扫描
- 时间子系统8_动态时钟(NO_HZ)
- 使用ajaxfileupload插件提示Uncaught TypeError:has no method 'handleError'
- android发送短信
- iOS开发-NSDictionary
- cocos2d-X 节点(CCBone.h)API
- oracle 11g gateway 连接sqlserver 2005 ,ORA-28545解决
- Python编码和UTF-8
- [LeetCode]3Sum Closest
- iOS开发-NSData
- 十三周——汉诺塔(2)