============================================
호출페이지
============================================
<SCRIPT LANGUAGE="JavaScript">
<!--
function get_cookie(name)
{
var x = 0;
var nameOfCookie = name + "=";
while ( x <= document.cookie.length )
{
var y = (x+nameOfCookie.length);
if ( document.cookie.substring( x, y ) == nameOfCookie )
{
if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
endOfCookie = document.cookie.length;
return unescape( document.cookie.substring( y, endOfCookie ) );
}
x = document.cookie.indexOf( " ", x ) + 1;
if ( x == 0 )
break;
}
return "";
}
function go_event_popup()
{
if (get_cookie("event_popup") != "ok")
{
noticeWindow =window.open('/common/popup/popup_event_eng.html','notice3','toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=370');
noticeWindow.opener = self;
}
}
//-->
</SCRIPT>
</head>
호출 함수 ==> go_event_popup();
============================================
호출된 팝업창
============================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Speed Book</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link href="/include/css/default2.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/include/js/common.js"></script>
<SCRIPT language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function close_popup()
{
setCookie("event_popup, "ok" , 1); //1은 하루동안 쿠키보관, 테스트시 팝업을 새로 열려면 -5로 설정
self.close();
}
window.moveTo(0,0);
// -->
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" onLoad="javascript:popup_size_onload(400,450);">
<table width="400" height="450" cellspacing="0" cellpadding="0" border="0" background="http://images.speedbook.co.kr/images2/event/popup_event_eng.jpg">
<tr>
<td height="430" colspan="3" align="right" valign="bottom" class="bpad7"><a onClick="close_popup();top.opener.parent.location.href='/board/?menu_id=64'" style="cursor:hand"><img src="http://images.speedbook.co.kr/images2/main3/bt.gif" width="100" height="45" hspace="27" vspace="3"></a><br><a onClick="close_popup();top.opener.parent.location.href='/board/?action=view&menu_id=41&no=86589'" style="cursor:hand"><img src="http://images.speedbook.co.kr/images2/main3/bt.gif" width="100" height="45" hspace="27" vspace="3"></a></td>
</tr>
<tr>
<td width="124" height="20"></td>
<td width="151" onClick="close_popup();" style="cursor:hand"></td>
<td width="125"></td>
</tr>
</table>
</body>
</html>
'Programming > JavaScript' 카테고리의 다른 글
천단위 마다 콤마추가하기 (0) | 2009.07.06 |
---|---|
자바스크립트에서 배열처리 및 숫자만입력하기 (0) | 2009.04.22 |
윈도우 엑스버튼 눌러서 강제종료시 이벤트 (0) | 2009.01.29 |
[펌]정규 표현식의 간략한 소개 (0) | 2009.01.09 |
[펌]마우스오르쪽금지버튼과 키보드 금지 태그 (0) | 2009.01.09 |