검색결과 리스트
오늘하루팝업띄우지않기에 해당되는 글 1건
- 2011.01.18 오늘 하루 팝업창 띄우지 않기 3
1.부모창 부분
<script type="text/javascript">
//이 부분부터 수정할 필요 없음
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 "";
}
//이부분까지 수정 필요 없음
function popup(){
if(getCookie("Notice") != "no"){ // 쿠키네임지정
var child = null;
child = window.open("/popup/member_drop_popup.jsp", "pop",
"width=650,height=500,notoolbars,resizable=no,scrollbars=auto"); //팝업 띄울 페이지 디렉토리 혹은 팝업창 웹페이지
child.focus();
}
return;
}
popup(); //자동으로 팝업 띄우기
</script>
2.팝업창 부분
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.frm.Notice.checked )
setCookie( "Notice", "no" , 1); //부모창에서 지정한 쿠키네임
self.close();
}
<input type="checkbox" name="Notice" value="열지않음"> 오늘 하루동안 이창을 열지 않음 <a href="#" onclick="javascript:closeWin();"> <font color="red"><b>[창닫기]</font></b></a>
팝업창으로 파라미터 넘기기 (0) | 2011.07.22 |
---|---|
팝업창에서 부모창으로 폼 전송 (0) | 2011.01.18 |
자바스크립트 형변환 (0) | 2010.02.08 |
isNAN 메서드 (0) | 2010.02.08 |
자바스크립트 패키지 사용 (0) | 2010.02.08 |
RECENT COMMENT