查看jQuery file upload的image preview如何工作的
作者:互联网
查看readme中的说明,
- JavaScript Load Image library v. 1.13.0+: Required for the image previews and resizing functionality.
- JavaScript Canvas to Blob polyfill v. 2.1.1+:Required for the image previews and resizing functionality.
注释掉这个js的引用
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<!--<script src="//blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>-->
然后发现错误在loadImage.parseMetaData,提示loadImage undefined
loadImageMetaData: function (data, options) { if (options.disabled) { return data; } var that = this, dfd = $.Deferred(); loadImage.parseMetaData(data.files[data.index], function (result) { $.extend(data, result); dfd.resolveWith(that, [data]); }, options); return dfd.promise(); },
在loadImageMetaData函数前面,加上console.trace(); 刷新页面,再次尝试,然后查看stack trace
标签:jQuery,image,JavaScript,upload,dfd,loadImage,data,options 来源: https://www.cnblogs.com/chucklu/p/11088583.html