티스토리 뷰

Tag & Script/JavaScript

팝업 소스

미련곰 2007. 8. 20. 15:30

================== index =========================

function getCookie( name )
{
 var nameOfCookie = name + "=";
 var x = 0;
 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 "";
}

 if ( getCookie( "event" ) != "done" )
 {
  noticeWindow  = window.open('링크주소','event','height=590, width=400, menubar=no, scrollbars=no, resizable=no, toolbar=no, status=no, top=100, left=100')
  noticeWindow.opener = self;
 }



================= pop ==================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">
<!--
  function popupClose(){
    setCookie("event", "done", 1000);
    self.close();
  }
 
  function setCookie( name, value, expiredays )
  {
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
  }

function linkToOpener(URL){
if (window.opener && !window.opener.closed)
window.opener.location = URL;
window.close();
}

//-->
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="400" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><a href="javascript:linkToOpener('링크주소');" ><img src="이미지주소" border="0"></a></td>
  </tr>
</table>
<table width="100%" height="25" bgcolor="#909090" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td align="right"><font color=#ffffff>오늘하루 열지않음</font> <input type="checkbox" onClick="popupClose();">&nbsp; </td>
  </tr>
</table>
</body>
</html>

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함