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
<script> | |
var loadFile = function(event) { | |
var output = document.getElementById('id_viewimg'); | |
output.src = URL.createObjectURL(event.target.files[0]); | |
}; | |
</script> | |
<input type="file" onchange="loadFile(event)"/> | |
<img id="id_viewimg" src="images/photo.gif" name="preview" border="0" /> |
from : http://stackoverflow.com/questions/4459379/preview-an-image-before-it-is-uploaded
///906.
'지속가능티끌 > JavaScript' 카테고리의 다른 글
JavaScript. 상수. (0) | 2016.12.07 |
---|---|
JavaScript. 배열 생성,shift, pop, unshift, push (0) | 2016.12.07 |
JavaScript. Object. Array (0) | 2016.07.28 |
JavaScript. 개체 만들기. (0) | 2016.07.27 |
JavaScript. 함수 (Functions) (0) | 2016.07.27 |
댓글