相思资源网 Design By www.200059.com
复制代码 代码如下:
function SetCookie(sName, sValue)
{
date = new Date();
var str=sName+"="+escape(sValue)+(";expires="+date.toGMTString())+";path=/";
str=str.replace("2010","2099");
document.cookie=str;
alert("恭喜,已成功屏蔽所有广告,只要不清空Cookie,您都不会再受广告困扰!");
//alert(unescape(document.cookie));
}
function DelCookie(name)
//删除Cookie
{
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
if(cval!=null) document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString()+";path=/"; ;
}
function NoCookie(sName, sValue)
{
date = new Date();
var str=sName+"="+escape(sValue)+(";expires="+date.toGMTString())+";path=/";
str=str.replace("2010","2009");
document.cookie=str;
alert("您已经恢复到广告版,谢谢您对的支持!");
//alert(unescape(document.cookie));
}
下面的函数比较常用,自己也在用
复制代码 代码如下:
function setCookie(name, value) //cookies设置JS
{
var argv = setCookie.arguments;
var argc = setCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
if(expires!=null)
{
var LargeExpDate = new Date ();
LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24));
}
document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString()));
}
function getCookie(Name) //cookies读取JS
{
var search = Name + "="
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search)
if(offset != -1)
{
offset += search.length
end = document.cookie.indexOf(";", offset)
if(end == -1) end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
else return ""
}
}
更多可以参考下一篇。
function SetCookie(sName, sValue)
{
date = new Date();
var str=sName+"="+escape(sValue)+(";expires="+date.toGMTString())+";path=/";
str=str.replace("2010","2099");
document.cookie=str;
alert("恭喜,已成功屏蔽所有广告,只要不清空Cookie,您都不会再受广告困扰!");
//alert(unescape(document.cookie));
}
function DelCookie(name)
//删除Cookie
{
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
if(cval!=null) document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString()+";path=/"; ;
}
function NoCookie(sName, sValue)
{
date = new Date();
var str=sName+"="+escape(sValue)+(";expires="+date.toGMTString())+";path=/";
str=str.replace("2010","2009");
document.cookie=str;
alert("您已经恢复到广告版,谢谢您对的支持!");
//alert(unescape(document.cookie));
}
下面的函数比较常用,自己也在用
复制代码 代码如下:
function setCookie(name, value) //cookies设置JS
{
var argv = setCookie.arguments;
var argc = setCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
if(expires!=null)
{
var LargeExpDate = new Date ();
LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24));
}
document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString()));
}
function getCookie(Name) //cookies读取JS
{
var search = Name + "="
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search)
if(offset != -1)
{
offset += search.length
end = document.cookie.indexOf(";", offset)
if(end == -1) end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
else return ""
}
}
更多可以参考下一篇。
相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com
暂无javascript cookies操作集合的评论...