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

<SCRIPT language="javascript">
//名称,地址,时间(小时)
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);

</SCRIPT>



//2------------------------------------------------------------------
<script>
先寫一個彈出的函數popAd()
var lefttime = 3 * 60 * 60 * 1000;
window.setTimeout(popad, lefttime);
</script>

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