同一IP只彈出一次窗口的特效代碼

網(wǎng)頁特效
2010-11-08 09:42:32 文/羅蓉蓉
<!-- 把下列代碼加到BODY中 -->
<script>
var cookieString = new String(documents.cookie)
var cookieHeader = 'happy_pop' //更換happy_pop為任意名稱
var beginPosition = cookieString.indexOf(cookieHeader)
if (beginPosition <0){
window.open('http://www.網(wǎng)址未加載/','','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設置過期時間,即多長間隔跳出一次
documents.cookie = 'happy_pop=yes;expires='+ Then.toGMTString() //更換happy_pop和第4行一樣的名稱
}//more javascript from http://www.網(wǎng)址未加載/
</script>