I\'m trying to load an image selected by the user through an element.
I added a onchange event handler to the input element like this:
$('document').ready(function () { $("#imgload").change(function () { if (this.files && this.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#imgshow').attr('src', e.target.result); } reader.readAsDataURL(this.files[0]); } }); });
That works for me in jQuery.