묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
팝업페이지와 메인페이지 연결방법, 소스좀 봐주세요
2003.09.25 09:41
처음 사이트 접속할 때 팝업창이 뜨게 하려고 합니다
팝업페이지는 이렇게 만들었구요 popup.htm
메인페이지 소소는 이게 맞나요??
<script>
window.open('popup.htm','win','width=500, height=400, top=100, left=200, scrollbars=no');>
</script>
요렇게만 넣으면 되나요?
[ popup.htm ]
<html>
<head>
<title>팝업띄우기</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<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 closeWin(){
if ( document.myform.check_box.checked ) {
setCookie( "main", "true" ,1 );
this.close();
}
}
function go(url) {
opener.location.href = url;
this.close();
}
//-->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100" border="0" cellspacing="0" cellpadding="0" class="text">
<tr>
<td height="100"><a href="http://www.자세한내용.co.kr" target="main" window.close();><img src="popup030925.gif" alt="" border="0"></a></td>
</tr>
</table>
<table width="100" border="0" cellspacing="0" cellpadding="0" bgcolor="ffffff">
<tr>
<form name="myform" method="post" action="">
<td height="20" align="center">
<span style="font-size:9pt;color:006770">오늘 하루 이 창을 띄우지 않습니다.</span>
<SCRIPT>
document.write("<input type=checkbox align=center value=ON name=check_box onClick=closeWin();>");
document.write("");
</SCRIPT>
</td>
</form>
</tr>
</table>
</body>
</html>
팝업페이지는 이렇게 만들었구요 popup.htm
메인페이지 소소는 이게 맞나요??
<script>
window.open('popup.htm','win','width=500, height=400, top=100, left=200, scrollbars=no');>
</script>
요렇게만 넣으면 되나요?
[ popup.htm ]
<html>
<head>
<title>팝업띄우기</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<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 closeWin(){
if ( document.myform.check_box.checked ) {
setCookie( "main", "true" ,1 );
this.close();
}
}
function go(url) {
opener.location.href = url;
this.close();
}
//-->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100" border="0" cellspacing="0" cellpadding="0" class="text">
<tr>
<td height="100"><a href="http://www.자세한내용.co.kr" target="main" window.close();><img src="popup030925.gif" alt="" border="0"></a></td>
</tr>
</table>
<table width="100" border="0" cellspacing="0" cellpadding="0" bgcolor="ffffff">
<tr>
<form name="myform" method="post" action="">
<td height="20" align="center">
<span style="font-size:9pt;color:006770">오늘 하루 이 창을 띄우지 않습니다.</span>
<SCRIPT>
document.write("<input type=checkbox align=center value=ON name=check_box onClick=closeWin();>");
document.write("");
</SCRIPT>
</td>
</form>
</tr>
</table>
</body>
</html>