24小时只弹一次

function Get(){
var Then = new Date()
Then.setTime(Then.getTime() + 24*60*60*1000)
var cookieString = new String(document.cookie)
var cookieHeader = "Cookie1="
var beginPosition = cookieString.indexOf(cookieHeader)
if (beginPosition != -1){
} else
{ document.cookie = "Cookie1=POPWIN;expires="+ Then.toGMTString()
var focusid=setTimeout("focus();var popAd=window.showModelessDialog(http://www.youname.com/tanchu.htm','dis','');",1000);
window.focus();
}
}Get();

http://www.youname.com/tanchu.htm为
<script language="JavaScript">
<!--
function openWindow2(URL,Name,features) { //v2.0
window.open(URL,Name,features);
}
openWindow2('http://www.hacker.cn','pop','resizable,scrollbars,location, top=0');
//-->
setTimeout('window.close();', 0);
</script>

你可能感兴趣的:(JavaScript)