Leya 发表于 2008-3-31 11:23:00

同一IP只弹出一次窗口的特效代码

<!-- 把下列代码加到BODY中 -->
<body>
<script>
  var cookieString = new String(document.cookie)
  var cookieHeader = 'happy_pop' //更换happy_pop为任意名称
  var beginPosition = cookieString.indexOf(cookieHeader)
  if (beginPosition <0){
window.open('http://bbs.bakbuy.com/index.aspx','','top=0,left=0,width=787,height=480,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,status=yes');
var Then = new Date()    
   Then .setTime(Then.getTime() + 12*60*60*1000 ) //同一ip设置过期时间,即多长间隔跳出一次
   document.cookie = 'happy_pop=yes;expires='+ Then.toGMTString()  //更换happy_pop和第4行一样的名称
    }//more javascript from http://www.bakbuy.com
</script>
</body>
页: [1]
查看完整版本: 同一IP只弹出一次窗口的特效代码