每1小时弹一次的弹窗代码


//名称,地址,时间(小时)
function PopAds(adsName,adsUrl,sTime)
{
    if(document.cookie.indexOf(adsName)==-1)
    {
        window.open(adsUrl,adsName);
        self.focus();
                var expireDate = new Date();
                var lefttime = 1000 * (3600 * sTime);
                expireDate.setTime (expireDate.getTime() + lefttime);
                document.cookie = adsName +"=yes" + "; expires=" + expireDate.toGMTString() +  ";";
    }

}

PopAds('s1',' http://www.sf98.cn',1);





//2------------------------------------------------------------------

你可能感兴趣的:(每1小时弹一次的弹窗代码)