728x90 반응형 preview1 [Javascript] 파일 첨부시 해당파일 새창에서 여는 방법 1. JSP 2. JS window.onload=function(){ target=document.getElementById('fileName'); target.addEventListener('change',function(){ if(target.value.length != 0){ // js에서는 파일 경로가 fakePath로 뜨기때문에 URL.create를 사용한다 var path = URL.createObjectURL(target.files[0]); window.open(path); // window.open으로 해당 파일을 새창으로 연다 //location.href(); $('#originName').html(target.files[0].name); }else{ $('#originName').htm.. 2023. 2. 13. 이전 1 다음 728x90 반응형