Last active
August 29, 2015 14:05
-
-
Save kucukkanat/791f3239d9af2ec1dafc to your computer and use it in GitHub Desktop.
File API get input value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('change','#imageUpload',function(e){ | |
var input = e.target; | |
var file = input.files[0]; | |
var reader = new FileReader(); | |
var dataURL = reader.readAsDataURL(file); | |
reader.onload = function(){ | |
var src = reader.result; | |
$("#uImagePrev").css({"background-image":"url("+src+")"}); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment