select and display image using FileReader
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
$("#blah").fadeIn(400).html('<img src="img/ajax-loader.gif" />');
}
reader.readAsDataURL(input.files[0]);
}
}
$(document).ready(function(){
$("#photoimg").change(function(){
readURL(this);
})
});
Using html to uploade and display image.
<img id="blah" alt="" src="images/avatar.jpg">
<input type="file" name="photoimg" id="image" value="" />?
In this tutorial, I have write code to add custom meta query in main query…
This website uses cookies.