Created
September 4, 2013 06:05
-
-
Save xu33/6433256 to your computer and use it in GitHub Desktop.
read image from upload
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
function view() { | |
var f = document.getElementById("file").files[0]; | |
var reader = new FileReader(); | |
reader.onload = (function(evt) { //evt get all value | |
document.getElementById('div').innerHTML = | |
"PIC :<img src=" + | |
evt.target.result + "/>" ; | |
}); | |
reader.readAsDataURL(f); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment