用 ajaxFileUpload 出现的问题:has no method 'handleError'、返回json数据提示下载
2013-11-20 12:14
826 查看
1. 提示错误:Uncaught TypeError: Object function (a,b){return new d.fn.init(a,b,g)} has no method 'handleError'
目前找到两种情况会出现这个错误:
(1)、url地址没访问到
(2)、$.ajaxFileUpload中的dataType的值为小写,只需要把只该成大写就ok了。比如dataType : 'JSON'
2.返回json数据在ie下提示下载
解决方法:
设置content-type为text/html或plain/text
目前找到两种情况会出现这个错误:
(1)、url地址没访问到
(2)、$.ajaxFileUpload中的dataType的值为小写,只需要把只该成大写就ok了。比如dataType : 'JSON'
jQuery.handleError is not a function 原因是handlerError只在jquery-1.4.2之前的版本中存在,jquery-1.6 和1.7中都没有这个函数了,因此在1.4.2中将这个函数复制到了ajaxFileUpload.js中,问题解决 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] ); } },
2.返回json数据在ie下提示下载
解决方法:
设置content-type为text/html或plain/text
相关文章推荐
- 用 ajaxFileUpload 出现的问题:has no method 'handleError'、返回json数据提示下载 、一直返回error
- 当使用JQuery的"$",抛异常Uncaught TypeError: Object #<Object> has no method 'ajax'
- Struts2 使用ajax访问action,返回json格式数据,提示error:There is no result type defined for type 'json'
- 使用ajaxfileupload插件提示Uncaught TypeError:has no method 'handleError'
- 出现TypeError: Object #<Object> has no method 'createClient' 错误
- sencha touch中出现JS错误Uncaught TypeError: Object [object Object] has no method 'getForm'
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- springmvc+easyui Ajax提交返回json IE出现下载问题
- Uncaught TypeError: Object [object Object] has no method 'live'
- 关于webview调用js出现has no method 'toString'
- 上传文件返回的json数据会被提示下载问题解决方案
- 使用ajaxFileUpload与SpringMVC实现异步上传下载文件并返回json数据
- jquery dialog异常 Uncaught TypeError: Object [object Object] has no method 'dialog'
- net.sf.json.JSONException: java.lang.NoSuchMethodException: Property 'username' has no getter method
- 如何解决“文件上传返回JSON数据,在IE下提示下载文件”的问题?
- AttributeError: 'Response' object has no attribute 'json'
- Uncaught TypeError: Object [object Object] has no method 'highcharts'
- 如何解决“文件上传返回JSON数据,在IE下提示下载文件”的问题?
- has no method 'ajax'
- 解决springmvc返回json数据IE出现文件下载和json数据中文乱码问题