码迷,mamicode.com
首页 > 其他好文 > 详细

一天弹出一次广告cookie

时间:2015-03-12 18:43:59      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:

function setCookie(name, value, expire) {
window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}
function getCookie(Name) {
var search = Name + "=";
if (window.document.cookie.length > 0) {
offset = window.document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = window.document.cookie.indexOf(";", offset);

if (end == -1)
end = window.document.cookie.length;
return unescape(window.document.cookie.substring(offset, end));
}
}
return null;
}
function register(name) {
var today = new Date();
var expires = new Date();
expires.setTime(today.getTime() + 1000*60*60*24);
setCookie("ItDoor", name, expires);
}
function openWin() {
var c = getCookie("ItDoor");
if (c != null) {
return;
}
register("xiaolin");
if($("#ad-c").find("img").attr("src") !="" && $("#ad-c").find("img").attr("src") !=undefined){
$("#ad-pop,#ad-c").show();
}


}
$(function(){
$("#js-close,#ad-pop,#ad-c").click(function(){
$("#ad-pop,#ad-c").hide();
});
});
openWin();

一天弹出一次广告cookie

标签:

原文地址:http://www.cnblogs.com/xiaotaiyang/p/4333097.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!