lilith's profile逆插桃花PhotosBlogLists Tools Help

Blog


    March 02

    只弹一次定时弹出窗口

    <script>
    function openwin(){
     setTimeout('window.open("xx.html","","scrollbars=yes,width=630,height=650")',60000);
    }
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset);
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }
    function loadpopup(){
    if (get_cookie('popped')==''){
    openwin()
    document.cookie="popped=yes"
    }
    }
    <body onLoad="loadpopup()" >