Hadeel e

Hadeel e

  • NA
  • 50
  • 6.1k

readURL with JOuery

Mar 30 2020 12:07 PM
Hi,
I am trying to allowing the end user to edit and see the images that have been edited using jOuery.
However, I am geetting no such changes.
the following is my code:
  1. <script type="text/javascript">  
  2. $.noConflict();  
  3. function readURL(input) {  
  4. var reader = new FileReader();  
  5. if (input.files && input.files[0]) {  
  6. reader.onload = function (e) {  
  7. jQuery('#proImg').attr('src', e.target.result);  
  8. }  
  9. reader.readAsDataURL(input.files[0]);  
  10. else if (input.files && input.files[1]) {  
  11. reader.onload = function (w) {  
  12. jQuery('#licImg').attr('src', w.target.result);  
  13. }  
  14. reader.readAsDataURL(input.files[1]);  
  15. }  
  16. }  
  17. jQuery('#profileImg, #licenseImg').change(function () {  
  18. jQuery('#profileImg').readURL();  
  19. jQuery('#licenseImg').readURL();  
  20. });  
  21. </script>  
Thank you.

Answers (1)