사이트 내 전체검색
팝업창 다시띄우지 않는 스크립트
https://cmd.kr/javascript/195 URL이 복사되었습니다.

본문

<html>
<head>
<title>팝업창 다시띄우지 않는 스크립트 </title>

<SCRIPT LANGUAGE="JavaScript">
<!--
function change(form)
{
if (form.url.selectedIndex !=0)
parent.location = form.url.options[form.url.selectedIndex].value
}
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
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( "Notice" ) != "done" )
{
noticeWindow =
window.open('popup.html','notice','toolbar=no,location=no,directories=no,status=no,menubar=no,
scrollbars=no,resizable=no,width=400,height=200,top=100,left=80');
noticeWindow.opener = self;
}
// -->
</SCRIPT>
</head>

<body>

</body>

</html>




팝업창 문서에 들어갈 소스




<html>
<head>
<title>팝업창 다시띄우지 않는 스크립트 </title>

<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.forms[0].Notice.checked )
setCookie( "Notice", "done" , 1);
self.close();
}

// -->
</SCRIPT>
</head>

<body>

<form>
<input type=CHECKBOX name="Notice" value="">다시 열지 않음
<a href="javascript:history.onclick=closeWin()">닫기</a>
</form>

</body>

</html>

출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=7

댓글목록

등록된 댓글이 없습니다.

831 (11/17P)

Search

Copyright © Cmd 명령어 18.191.165.149