使用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 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM