<body 이외에 팝업을 넣을수 있을까요 ? 정보
그누보드 <body 이외에 팝업을 넣을수 있을까요 ?본문
현재
<script language="JavaScript">
<!--
function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//-->
</script>
</head>
와
<body onunload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 클로우즈 될때 사이트 팝업
<body onload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 오픈될때 사이트 팝업
이용하려고 하는데
head.sub.php 의 <body> 에 넣으면 게시판에 들어갈때,나올때 마다 계속 불려져 오게 됩니다.
다른 방법이 없을까요 ?
원하는건 사이트를 완전히 닫고 나올때 특정사이트가 팝업이 되도록 하는 것입니다.
<script language="JavaScript">
<!--
function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//-->
</script>
</head>
와
<body onunload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 클로우즈 될때 사이트 팝업
<body onload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 오픈될때 사이트 팝업
이용하려고 하는데
head.sub.php 의 <body> 에 넣으면 게시판에 들어갈때,나올때 마다 계속 불려져 오게 됩니다.
다른 방법이 없을까요 ?
원하는건 사이트를 완전히 닫고 나올때 특정사이트가 팝업이 되도록 하는 것입니다.
댓글 전체
pop.htm <----- 요놈도 같이 만들어서 올리믄 되는디여....
위에 소스는 페이지 로딩되는 아무데나 넣으면 되구여...헤드나 메인이나 풋이나...셋중에 추천은 메인에다가..
위에 소스는 페이지 로딩되는 아무데나 넣으면 되구여...헤드나 메인이나 풋이나...셋중에 추천은 메인에다가..
세션으로 해보려고 index.php 를 봤는데 PHP에는 거의 문맹(?)이라 그누보드에서 세션을 어떻게 처리하는지 잘 감이 안오더군요. 회원이 아닌경우만 세션으로 처리 하는것 같더군요. 위의 "엊그제저녁님"의 쿠키 소스를 힌트로 열심히 뒤지고 있습니다. 어쨌든 위의 소스만 잘라 붙여가지고는 안되더군요.
<script language="JavaScript">
<!--
//쿠키값을 가져오는 함수
function getCookie(name) {
var from_idx = document.cookie.indexOf(name+'=');
if (from_idx != -1) {
from_idx += name.length + 1
to_idx = document.cookie.indexOf(';', from_idx)
if (to_idx == -1) {
to_idx = document.cookie.length
}
return unescape(document.cookie.substring(from_idx, to_idx))
}
}
var CloseDate = new Date("December 31, 2003"); //팝업 윈도우를 닫고자 하는 날짜를 입력하세요.
var Today = new Date(); //오늘 날짜
if (Today < CloseDate)
{
//getCookie 함수를 호출하여 쿠키값을 가져온다.
var blnCookie = getCookie("op1");
//쿠키값이 true가 아닐 경우에만 새 창을 띄운다.
if ( !blnCookie ) {
win = window.open("pop.htm","op1","width=600,height=710,left=0,top=0");
win.focus();
}
}
//-->
</script>
<!--
//쿠키값을 가져오는 함수
function getCookie(name) {
var from_idx = document.cookie.indexOf(name+'=');
if (from_idx != -1) {
from_idx += name.length + 1
to_idx = document.cookie.indexOf(';', from_idx)
if (to_idx == -1) {
to_idx = document.cookie.length
}
return unescape(document.cookie.substring(from_idx, to_idx))
}
}
var CloseDate = new Date("December 31, 2003"); //팝업 윈도우를 닫고자 하는 날짜를 입력하세요.
var Today = new Date(); //오늘 날짜
if (Today < CloseDate)
{
//getCookie 함수를 호출하여 쿠키값을 가져온다.
var blnCookie = getCookie("op1");
//쿠키값이 true가 아닐 경우에만 새 창을 띄운다.
if ( !blnCookie ) {
win = window.open("pop.htm","op1","width=600,height=710,left=0,top=0");
win.focus();
}
}
//-->
</script>
<script>
document.onload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1)";
</script>
document.onload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1)";
</script>
리프레쉬 될때도 안나오고 완전히 close 될때만 나오게 하는건 html 만으로는 안되겠네요. 오픈될때 팝업과는 차이가 있네요. XXX 사이트 들은 그래도 잘 하던데요.
body 두번써도 에러안나던데요.... 전 body를 그냥 아무데나 넣어서 씁니다;;;