윈도우 창 닫힐 때 새창 띄우는 스크립스 예제
<%@ page import="java.sql.*" contentType="text/html;charset=euc-kr" %>
<html>
<head>
<SCRIPT for="window" event="onunload">
if (self.screenTop > 9000){
alert('브라우저 닫힘');
// window.open('/ksm/2.jsp', '', 'width=400,height=150,scrollbars=yes,resizable=yes,top=250,left=350,dependant=no');
window.open('/ksm/2.jsp','', 'left=2000, top=2000, width=0, height=0, scrollbars=no, resizable=no, toolbar=no, menubar=no, directories=no, status=no');
}
else{
if (document.readyState == "complete"){
alert('새로고침');
window.open('/ksm/2.jsp','', 'left=2000, top=2000, width=0, height=0, scrollbars=no, resizable=no, toolbar=no, menubar=no, directories=no, status=no');
}else if (document.readyState == "loading"){
alert('다른 사이트로 이동');
}
}
</SCRIPT>
</head>
<body>
1.jsp 입니다.<p>
<hr>
</body>
</html>