Js上传图片 jquery:ajaxfileupload和angular:angular-file-upload
2016-12-20 09:29
751 查看
jquery
jquery无刷新上传图片可使用ajaxfileupload插件,其中可能遇到的错误Uncaught TypeError: jQuery.handleError is not a function上传出错时才会出现
只要在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] ); } },
angular
可以参考 https://github.com/nervgh/angular-file-upload 中的demo效果图
代码地址 https://github.com/halfopen/frontend-demos/tree/master/upload-image
相关文章推荐
- jQuery 图片上传 ajaxfileupload.js PDF文件上传实例
- Jquery ajaxfileupload.js结合.ashx文件实现无刷新上传
- 一个简单的jQuery插件ajaxfileupload.js实现ajax上传文件例子
- 关于ajaxfileupload.js一些问题和上传图片就立即显示图片功能
- ajaxfileupload.js、struts2、ajax、json异步上传图片
- jquery.fileupload.js插件使用初探--单图片上传预览
- jquery_file_upload in Rails(ajax实现多张图片上传)
- 使用ajax上传图片(ajaxfileupload.js)
- jQuery插件之ajaxFileUpload(异步上传图片并实时显示,并解决onchange后ajaxFileUpload失效问题)
- ajaxfileupload.js异步上传图片
- ajaxfileupload.js 实现异步上传图片
- 利用ajaxfileupload.js实现跨域上传图片并处理返回的数据
- ajaxFileUpload.js 无刷新上传图片,支持多个参数同时上传
- 浏览器图片\文件上传到服务器 ajaxfileupload.js使用实例
- jquery.fileupload.js插件使用初探--多图片上传预览
- jquery插件--ajaxfileupload.js上传文件原理分析
- jquery插件--ajaxfileupload.js上传文件原理分析
- 关于ajaxfileupload.js上传图片使用历程(struts2)
- jQuery插件之ajaxFileUpload(异步上传图片并实时显示,并解决onchange后ajaxFileUpload失效问题)
- ajaxFileUpload.js 无刷新上传图片,支持多个参数同时上传,支持 ie6-ie10