¡@

Home 

2014/10/16 ¤W¤È 12:06:55

jquery Programming Glossary: readurl

Image Upload with Preview and Delete

http://stackoverflow.com/questions/10206648/image-upload-with-preview-and-delete

DOCTYPE html html head script src http ajax.googleapis.com ajax libs jquery 1 jquery.min.js script script function readURL input if input.files input.files 0 var reader new FileReader reader.onload function e '#img_prev' .attr 'src' e.target.result.. article aside figure footer header hgroup menu nav section display block style head body input type 'file' onchange readURL this img id img_prev src # alt your image body html javascript jquery upload share improve this question DEMO Tested.. jquery 1 jquery.min.js script script var blank http upload.wikimedia.org wikipedia commons c c0 Blank.gif function readURL input if input.files input.files 0 var reader new FileReader reader.onload function e '#img_prev' .attr 'src' e.target.result..

Preview an image before it is uploaded

http://stackoverflow.com/questions/4459379/preview-an-image-before-it-is-uploaded

javascript jquery file upload share improve this question Please take a look at the sample JS code below function readURL input if input.files input.files 0 var reader new FileReader reader.onload function e '#blah' .attr 'src' e.target.result.. function e '#blah' .attr 'src' e.target.result reader.readAsDataURL input.files 0 #imgInp .change function readURL this and the associated HTML form id form1 runat server input type 'file' id imgInp img id blah src # alt your image form..