使用jQuery文件流读取文件

1  if (FileReader) {
2                 var reader = new FileReader(), file = this.files[0];
3                 reader.onload = function (e) {
4                     $("#userImage").attr("src", e.target.result);
5                     $("#smallImg").attr("src", e.target.result);
6                 };
7                 reader.readAsDataURL(file);
8 }

 

文章来自:http://www.cnblogs.com/sunnypron/p/5422292.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3