js基础:限量版广告 1个IP一天只弹一次的AD代码
2010-09-14 13:36:08 来源:WEB开发网 ---------------------------ad.js-的代码如下:---------------------------------
functionsetCookie(name,value,expire){
window.document.cookie=name+"="+escape(value)+((expire==null)?"":(";expires="+expire.toGMTString()));
}
functiongetCookie(Name){
varsearch=Name+"=";
if(window.document.cookie.length>0){//ifthereareanycookies
offset=window.document.cookie.indexOf(search);
if(offset!=-1){//ifcookieexists
offset+=search.length; //setindexofbeginningofvalue
end=window.document.cookie.indexOf(";",offset) //setindexofendofcookievalue
if(end==-1)
end=window.document.cookie.length;
returnunescape(window.document.cookie.substring(offset,end));
}
}
returnnull;
}
functionregister(name){
vartoday=newDate();
varexpires=newDate();
expires.setTime(today.getTime()+1000*60*60*24);
setCookie("ItDoor",name,expires);
}
varexitURL=http://homepage.yesky.com/;
functionopenWin(){
varc=getCookie("ItDoor");
if(c!=null){
return;
}
$False$
register("xiaolin");
varfeatureStr="''";
featureStr="'top=0,left=0,width=800,height=600,toolbar=yes,menubar=no,scrollbars=no,resizable=no,location=no,status=no,center:no'";
self.focus();
varExitWindow=window.open(exitURL,'',featureStr);
ExitWindow.focus();
}
openWin();
window.focus()
更多精彩
赞助商链接