부모창 종료시 팝업창 닫기
<html>
<head>
<script>
window.open('http://www.naver.com','testwin','width=800,height=600');
function close_pop()
{
try{
if (/MSIE/.test(navigator.userAgent)) {
if(navigator.appVersion.indexOf("MSIE 7.0")>=0) {
//IE7에서는 아래와 같이
window.open('about:blank','testwin').close();
}
else {
//IE7이 아닌 경우
window.opener = testwin;
testwin.close();
}
} else {
window.name = '__t__';
var w = window.open('about:blank');
w.document.open();
w.document.write('<html><body><script
type="text/javascript">function _(){var
w=window.open("about:blank","'+window.name+'");w.close();self.close();}</'+'script></body></html>');
w.document.close();
w._();
}
}catch(ex){
alert(ex.name+":"+ex.message);
}
}
</script>
</head>
<body onUnload="javascript: close_pop();">
</body>
</html>