웹코딩을 하다보면 인터넷익스플로러(이하 IE)를 자동으로 닫아야 하는 경우가 있습니다.

팝업이라면 window.close() , self.close() 정도면 되겠지만 팝업이 아닐경우 이렇게 하면

창을 닫겠냐고 문구가 뜨게 되죠, 전 그냥 닫히기를 원하는데.. 

그래서 약간의 꽁수를 쓰면 말없이 닫기가 가는한데 IE버전에 따라 조금씩 틀리지요...

그럼 보겠습니다..

IE6 :
window.opener = self; 
self.close(); 
IE7 :
window.open('about:blank','_self').close();
IE8 :
window.opener='Self';
window.open('','_parent','');
window.close();


참 쉽죠이~~~ ^^

즐거운 코딩 하세요~~~













웹에서 출력을 할경우 자바스크립트 print() 함수를 이용합니다.
근데 출력을 하다 보면 양이 많아 페이지를 잘라 출력을 해야 할때가 있는데..
이때.. <p style="page-break-before: always;"> 페이지를 넘기기 위해 이렇게
태그를 사용합니다.. 하지만 요즘 IE7에서 이게 안 먹히는 경우가 있더군요......
해결법은... 아래와 같이 br을 추가해 주시면 됩니다....

자자 어서 한번 해보세요~~~

<p style="page-break-before: always;">
<br style="height:0;line-height:0" >



IE 7 이전
<p style="page-break-before: always;">

IE 7 버전
<p style="page-break-before: always;">
<br style="height:0;line-height:0" >
사용자 삽입 이미지
 

















<script >
 var src=new String(document.location);
 var srcName=src.split("value=")[1];

// QueryString값이 인코딩 되어 올경우 아래처럼 decodeURIComponent를 써준다...
 document.getElementById("ViewImage").src=decodeURIComponent(srcName);
 </script>

+ Recent posts