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
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
6 |
브라우저의 스크롤을 따라다니는 레이어 두번째
![]() | 황제낙엽 | 2002.12.20 | 519 |
5 |
무지개링크 (rainbowlink)
![]() | 황제낙엽 | 2005.07.16 | 474 |
» | 팝업창을 다시 띄우지 않는 소스 | 황제낙엽 | 2005.07.16 | 508 |
3 | 자바스크립트 내장 함수 활용하기 | 황제낙엽 | 2005.04.25 | 497 |
2 | XP 에서 input type=text 와 input type=password 의 사이즈가 틀리게 보일때 | 황제낙엽 | 2004.08.04 | 485 |
1 | 자바스크립트로 서버의 XML파일을 접근 (실패했슴) | 황제낙엽 | 2005.12.11 | 697 |