Home  >  Article  >  Web Front-end  >  getAsDataURL在Firefox7.0下无法预览本地图片的解决方法_javascript技巧

getAsDataURL在Firefox7.0下无法预览本地图片的解决方法_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:15:001206browse

用uchome普通上传来举例,取原代码:return obj.files.item(0).getAsDataURL();

升级到Firefox7.0后,需要改为:return window.URL.createObjectURL(obj.files[0]);

实际上就是Firefox7.0废弃了item属性。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn