천

퇴장시 팝업창 한번한 띄우기 입니다.

· 2016-01-22 (금) 13:20:59 · 2711

<html>
<head>
<script language="JavaScript">
<!--
function Cookie(document, name, hours, path, domain, secure) {
    this.$document = document;
    this.$name = name;
    if (hours)
        this.$expiration = new Date((new Date()).getTime() + hours*3600000);
    else
        this.$expiration = null;
    if (path) this.$path = path; else this.$path = null;
    if (domain) this.$domain = domain; else this.$domain = null;
    if (secure) this.$secure = true; else this.$secure = false;
}

function _Cookie_store() {
    var cookieval = "";
    for(var prop in this) {

        if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function'))
            continue;
        if (cookieval != "") cookieval += '&';
        cookieval += prop + ':' + escape(this[prop]);
    }

    var cookie = this.$name + '=' + cookieval;
    if (this.$expiration)
        cookie += '; expires=' + this.$expiration.toGMTString();
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    if (this.$secure) cookie += '; secure';

    this.$document.cookie = cookie;
}

function _Cookie_load() {
    var allcookies = this.$document.cookie;
    if (allcookies == "") return false;

    var start = allcookies.indexOf(this.$name + '=');
    if (start == -1) return false; 
    start += this.$name.length + 1; 
    var end = allcookies.indexOf(';', start);
    if (end == -1) end = allcookies.length;
    var cookieval = allcookies.substring(start, end);

    var a = cookieval.split('&'); 
    for(var i=0; i < a.length; i++)
        a[i] = a[i].split(':');

    for(var i = 0; i < a.length; i++) {
        this[a[i][0]] = unescape(a[i][1]);
    }
    return true;
}

function _Cookie_remove() {
    var cookie;
    cookie = this.$name + '=';
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    cookie += '; expires=Fri, 31-Jan-2001 00:00:00 GMT';

    this.$document.cookie = cookie;
}

new Cookie();
Cookie.prototype.store = _Cookie_store;
Cookie.prototype.load = _Cookie_load;
Cookie.prototype.remove = _Cookie_remove;

function Popup(site) {
    var exp = 8760;
    var page = "http://www.yahoo.co.kr"; // 사이트 주소
    var windowprops = "width=300,height=300,location=no,toolbar=no,menubar=no,scrollbars=no"; // 옵션 설정
    var temp = new Cookie(document, "nanumi", exp);

    if (!temp.load()) {
        temp.firstload = site;
        temp.store();
            subwin=window.open(page, "", windowprops);
    }
}
-->
</script>
</head>

<body onunLoad="Popup('nanumi');">

팝업창을 최초 접속시 딱 한번만 띄웁니다.. 팝업창이 뜨는걸 확인하셨다면 팝업창을 닫고 본 페이지를 새로고침 해보세요.. 더 이상 팝업이 실행되지 않습니다.

</body>
</html> 

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-06-11 조회 3,075
16-02-15 조회 3,304
16-02-02 조회 2,973
16-01-25 조회 2,588
16-01-18 조회 2,694
16-01-08 조회 2,607
16-01-07 조회 2,617
16-01-05 조회 2,652
16-01-05 조회 2,951
16-01-05 조회 2,902
16-01-05 조회 2,806
16-01-04 조회 2,666
16-01-04 조회 2,673
16-01-04 조회 2,621
16-01-04 조회 2,535
15-12-30 조회 2,887
15-12-24 조회 2,700
15-12-24 조회 2,697
15-12-24 조회 2,725
15-12-24 조회 2,678
15-12-23 조회 2,667
15-12-16 조회 2,761
15-12-15 조회 2,823
15-12-11 조회 2,948
15-12-10 조회 2,810
15-11-09 조회 2,792
15-11-09 조회 3,014
15-10-06 조회 3,351
15-10-02 조회 3,129
15-05-29 조회 4,462
15-02-02 조회 4,439
15-01-18 조회 4,425
14-10-25 조회 8,382
14-10-25 조회 5,162
14-10-22 조회 7,167
14-10-22 조회 4,867
14-10-22 조회 4,822
14-10-18 조회 5,688
14-10-17 조회 6,065
14-10-17 조회 5,447
14-10-17 조회 8,980
14-10-17 조회 6,459
14-10-13 조회 4,386
14-10-13 조회 4,486
14-10-07 조회 6,162
14-09-24 조회 3,931
14-09-23 조회 3,996
14-09-22 조회 4,902
14-09-22 조회 6,134
14-09-22 조회 4,100
14-09-22 조회 3,771
14-09-21 조회 4,391
14-09-21 조회 3,875
14-09-20 조회 3,879
14-09-20 조회 3,781
14-09-20 조회 3,960
14-09-19 조회 3,883
14-09-19 조회 4,046
14-09-19 조회 3,930
14-09-19 조회 4,313
14-09-19 조회 3,954
14-09-19 조회 3,879
14-09-19 조회 4,167
14-09-19 조회 3,900
14-09-19 조회 3,948
14-09-19 조회 3,935
14-09-18 조회 4,012
14-09-18 조회 3,966
14-09-18 조회 4,237
14-09-18 조회 4,203
14-09-18 조회 4,216
14-09-18 조회 4,913
14-09-18 조회 5,469
14-09-18 조회 5,357
14-09-18 조회 4,158
14-09-18 조회 4,650
14-09-18 조회 4,269
14-08-30 조회 5,538
14-08-06 조회 6,023
14-08-06 조회 5,638
14-08-03 조회 5,275
14-06-12 조회 5,545
14-05-11 조회 3,731
14-05-11 조회 4,492
14-05-11 조회 4,595
14-05-09 조회 1.3만
14-05-01 조회 5,193
14-03-30 조회 4,396
14-03-23 조회 8,019
14-02-12 조회 3,901
13-10-29 조회 7,862
13-10-28 조회 8,688
13-09-29 조회 6,656
13-09-29 조회 4,285
13-07-23 조회 5,158
13-07-23 조회 1.2만
13-07-14 조회 4,690
13-07-14 조회 5,079
13-07-14 조회 6,042
13-07-14 조회 5,319