sitelink1 | |
---|---|
sitelink2 | |
sitelink3 | |
sitelink4 | |
extra_vars4 | |
extra_vars5 | |
extra_vars6 |
팝업창을 띄울 페이지에 들어갈 소스
<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>
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
17 | Barcode Detection API | 황제낙엽 | 2023.08.06 | 7 |
16 | (Copilot) 바닐라 스크립트가 뭐지? | 황제낙엽 | 2023.02.24 | 7 |
15 | 배열에 대한 루프문 조회 (loop iterator) | 황제낙엽 | 2023.03.01 | 3 |
14 | (Copilot) JSON 객체의 내부 데이터 리스트 길이를 구하는 방법 | 황제낙엽 | 2023.03.30 | 2 |
13 | fetch() 함수 사용 예제 | 황제낙엽 | 2023.11.23 | 1 |
12 | 현재 document 의 host 와 port 를 얻는 방법 | 황제낙엽 | 2023.10.03 | 1 |
11 | 모바일 브라우저에서 file input element 를 이용하여 여러장의 이미지를 서버에 전송하려 할때 | 황제낙엽 | 2023.08.21 | 1 |
10 | navigator.mediaDevices | 황제낙엽 | 2023.08.21 | 1 |
9 | 체크박스에 체크된 항목 개수 구하기 | 황제낙엽 | 2023.06.10 | 1 |
8 | JSON 클래스가 지원하는 function | 황제낙엽 | 2023.03.31 | 1 |
7 | CryptoJS 를 이용한 암호화 | 황제낙엽 | 2023.02.15 | 1 |
6 | json 데이터 내의 변수명에 prefix 로 type 표현하기 | 황제낙엽 | 2024.04.15 | 0 |
5 | (Bard) FileReader 로 여러개의 파일을 read 하는 법 | 황제낙엽 | 2023.08.23 | 0 |
4 | How to build a file upload service with vanilla JavaScript | 황제낙엽 | 2023.08.22 | 0 |
3 | (Bard) JavaScript로 JSON 배열을 작성하는 방법 | 황제낙엽 | 2023.08.21 | 0 |
2 | [URLSearchParams] URL 파라미터(매개변수) 값 가져오기 | 황제낙엽 | 2023.02.02 | 0 |
1 | 정규식을 이용한 이메일 검증 스크립트 | 황제낙엽 | 2023.06.25 | 0 |