2018년 1월 26일 금요일

[javascript] inp[ut file 변경시 변경된 이미지 화면 표시(익스 11, 크롬 정상 작동)

$(document).ready(function(){
$(".uploadfile").on("change",function(){
var objId = $(this).attr("id");

var target = $(this).next();
var val = $(this).val();
var thisDom = $(this)[0];
if (thisDom.files && thisDom.files[0]) {
       
           var reader = new FileReader();
           reader.onload = function (e) {
           
           
            $(target).css("max-width","100%");
               $(target).attr('src', e.target.result);
           }
        }else{
       
        }
        reader.readAsDataURL(thisDom.files[0]);
   
        return false;
});
});


ready 함수에 이벤트 등록



<input  class="uploadfile" type="file" name="mb_biz_img_path">
<img style="max-width:100%;" src="${sessionScope.rb_member.MB_BIZ_IMG_PATH}" alt="이미지가 없습니다." class="uploadImage"/>

밑에 uploadImage 클래스 img 태그를 추가




댓글 없음:

댓글 쓰기

[oracle]옵티마이저(Optimizer)와 실행 계획, 실전 튜닝 기초 완벽 정리

[Oracle SQL] 옵티마이저(Optimizer)와 실행 계획, 실전 SQL 튜닝 가이드 이 가이드에서는 오라클 데이터베이스의 핵심 엔진인 옵티마이저의 원리를 이해하고, DBeaver와 SQL Developer를 활용하여 실제 쿼리의 실행 계획을...