Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <script> function readURL(input) {
  2. if (input.files && input.files[0]) {
  3. var reader = new FileReader();
  4. reader.onload = function (e) {
  5. $('#blah').attr('src', e.target.result).width(100).height(100);
  6. };
  7. reader.readAsDataURL(input.files[0]);
  8. }
  9. }
  10. </script>
  11.  
  12. <img id="blah" src="<?php echo getImage('boy.png'); ?>" width="100px" height="100px">
  13.  
  14. onchange="readURL(this);" //it should to be use with input field //type="file"
Add Comment
Please, Sign In to add comment