천

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

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

<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-03 조회 3,008
15-07-30 조회 3,402
15-06-08 조회 5,546
15-05-27 조회 4,408
15-01-08 조회 6,703
14-12-30 조회 5,435
14-10-10 조회 5,425
14-08-13 조회 6,344
14-08-11 조회 5,201
14-08-06 조회 6,530
14-03-19 조회 7,428
13-04-26 조회 9,584
12-12-15 조회 5,108
12-12-15 조회 7,342
12-12-11 조회 5,477
12-11-21 조회 6,008
12-10-11 조회 5,091
12-10-03 조회 4,782
12-09-20 조회 6,080
12-09-02 조회 4,267
12-08-29 조회 5,258
12-08-29 조회 4,148
12-08-24 조회 4,244
12-08-18 조회 4,473
12-08-17 조회 4,514
12-08-16 조회 3,768
12-08-06 조회 5,547
12-08-05 조회 4,834
12-08-03 조회 4,550
12-08-03 조회 4,690
12-07-29 조회 3,552
12-07-24 조회 4,137
12-07-22 조회 3,609
12-07-20 조회 4,361
12-07-19 조회 4,709
12-07-19 조회 3,942
12-07-19 조회 3,887
12-07-19 조회 5,554
12-07-19 조회 3,496
12-07-18 조회 5,177
12-07-15 조회 4,152
12-07-14 조회 3,829
12-07-12 조회 4,505
12-07-11 조회 3,780
12-07-11 조회 3,500
12-07-11 조회 3,470
12-07-10 조회 4,652
12-07-09 조회 3,405
12-07-09 조회 4,228
12-07-09 조회 4,646
12-07-08 조회 4,561
12-07-07 조회 5,487
12-07-06 조회 4,739
12-07-06 조회 4,010
12-07-06 조회 3,895
12-07-06 조회 3,826
12-07-02 조회 5,508
12-07-02 조회 4,206
12-06-29 조회 3,727
12-06-28 조회 4,354
12-06-26 조회 3,848
12-06-26 조회 4,970
12-06-21 조회 3,944
12-06-20 조회 4,646
12-06-20 조회 4,275
12-06-15 조회 4,631
12-06-15 조회 4,369
12-06-13 조회 7,387
12-06-05 조회 7,362
12-06-04 조회 3,939
12-06-03 조회 3,786
12-05-31 조회 3,784
12-05-28 조회 6,629
12-05-27 조회 3,860
12-05-25 조회 3,995
12-05-23 조회 4,404
12-05-21 조회 5,118
12-05-17 조회 4,051
12-05-17 조회 3,972
12-05-09 조회 4,050
12-05-07 조회 4,300
12-05-02 조회 4,491
12-05-01 조회 4,667
12-04-30 조회 3,413
12-04-30 조회 4,357
12-04-25 조회 4,445
12-04-25 조회 4,870
12-04-24 조회 3,836
12-04-24 조회 4,601
12-04-23 조회 3,605
12-04-20 조회 3,248
12-04-17 조회 5,439
12-04-16 조회 4,377
12-04-14 조회 3,661
12-04-14 조회 3,686
12-04-14 조회 3,736
12-04-13 조회 3,362
12-04-13 조회 4,550
12-04-13 조회 6,186
12-04-12 조회 3,352