һ
 ¼ע

QQ¼

ֻһٿʼ

ƼĶ

+
̳ WEBҳǰ뿪 ǰ̨ű

HTML5 ͼƬϴԤ

[]
10520 websjy 2014-4-12 11:09:05
| ʾȫ¥
1F

ϵ½עᣬύѣø๦ܣϴزIJޣ

Ҫ ¼ ſػ鿴ûʺţ¼ע  

x
HTML5 ͼƬϴԤ

  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="author" content="EdieLei" />
  6. <title>HTML5 ͼƬϴԤ</title>
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  8. <script type="text/javascript">
  9. $(function(){
  10.     $('#img').change(function(){
  11.         var file = this.files[0];    //ѡϴļ
  12.         var r = new FileReader();
  13.         r.readAsDataURL(file);    //Base64
  14.         $(r).load(function(){
  15.             $('div').html('<img src="'+ this.result +'" alt="" />');
  16.         });
  17.     });
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <h3>HTML5 ͼƬϴԤ</h3>
  23. <input id="img" type="file" accept="image/*" /><br />
  24. <div></div>
  25. </body>
  26. </html>
ƴ
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ
б

ֹ

̳¡ͼƬѷϴվԭתԻ,µİȨԭ
վַİȨ֪ͨǵĹԱ,Ա(Email:admin@websjy.com)ʱȡȨɾ
ܾκκʽڱ̳л񹲺͹ִ!

QQ| 42011102000510|Archiver|ֻ|Դ ( ICP14013341-1

GMT+8, 2018-12-11 22:36

Powered by Discuz! X3.2

ԴԴվ  ԴAPPӦ֮

ٻظ ض б