일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- C#
- soundpool
- dovecot
- roundcube
- android 효과음
- PHP
- 자동 생성
- 안드로이드 푸시
- Android
- 우분투
- mysql
- not working
- php 취약점
- Mail Server
- 안드로이드 푸쉬
- 안드로이드 gcm
- 폼메일
- UML
- xe
- 자바스크립트
- 설치
- chart.js
- php 시큐어코딩
- javascript
- 안드로이드
- html5
- WebView
- FCM
- C# IO
- curl
- Today
- Total
그러냐
팝업 오늘하루 이창 열지 않기 본문
<html>
<head>
<title> 팝업 </title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link rel="stylesheet" href="/include/text.css" type="text/css">
<SCRIPT language="JavaScript">
<!--
// 쿠키를 만듭니다. 아래 closeWin() 함수에서 호출됩니다
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.pop.Notice1.checked )
setCookie( "NEW1", "done" , 1); // 오른쪽 숫자는 쿠키를 유지할 기간을 설정합니다
self.close();
}
// -->
</SCRIPT>
</head>
<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="pop">
<table width="600" border="0" cellspacing="0" cellpadding="0" height="350">
<tr>
<td valign="top" bgcolor="#000000">팝업입니다.이미지를 거의 넣겠죠.
</td>
</tr>
<tr>
<td valign="top" bgcolor="#000000"><table width="88%" border="0" align="right" cellpadding="0" cellspacing="0" class="font1">
<tr>
<td width="87%" height="23" bgcolor="#000000"><input type="checkbox" name="Notice1" value="">
<span class="text style1"> <font color="#FFFFFF">오늘 하루 이창을 열지않음</font></span></td>
<td width="13%" height="23"><a href="javascript
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
이페이지의 이름은 test_popup.html로 하겠습니다.
--------------여기까지가 팝업.html입니다....오늘 하루 이창을 열지않음 쿠키 set까지 합니다.-------
이제 이팝업을 띄울...html을 만듭니다.. 이페이지가 열릴때 저위에 팝업이 뜨겠죠.
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function notice_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 "";
}
function open_pop() {
if ( notice_getCookie( "NEW1" ) != "done" ) {
window.open('test_popup.html','notice1','width=800,height=415, left=1,top=1');
}
}
</script>
</head>
<body onload="javascript:open_pop()">
</body>
</html>
test.html로 저장합니다 같은 폴더에 넣어 놓고 test.html을 클릭해서 열면 팝업이 열립니다.
[출처] [링크스크랩] 팝업 오늘하루 이창 열지 않기|작성자 관절분리
'javascript' 카테고리의 다른 글
selectbox index 값 구하기 설정하기 (0) | 2016.01.27 |
---|---|
Document의 하위객체 - Select 객체 (0) | 2016.01.27 |
이메일 체크 정규식 (0) | 2016.01.27 |
자바스크립트에서 제공하는 함수를 사용하여 숫자만 입력받기 (0) | 2016.01.27 |
select box 에서 텍스트 가져오기 (0) | 2016.01.27 |