//js获取cookie
/*获取Cookie值*/
function getCookie(c_name)
{
if(document.cookie.length>0){
c_start=document.cookie.indexOf(c_name + “=”)
if(c_start!=-1){
c_start=c_start + c_name.length+1
c_end=document.cookie.indexOf(“;”,c_start)
if(c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
}
}
return “”
}
**********************************//JS操作cookies方法! *****************************************************************
//写cookies
function setCookie(name,value)
{
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + “=”+ escape (value) + “;expires=” + exp.toGMTString();
}
//读取cookies
function getCookie(name)
{
var arr,reg=new RegExp(“(^| )”+name+”=([^;]*)(;|$)”);
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
//删除cookies
function delCookie(name)
{
var exp = new Date();
exp.setTime(exp.getTime() – 1);
var cval=getCookie(name);
if(cval!=null)
document.cookie= name + “=”+cval+”;expires=”+exp.toGMTString();
}
//使用示例
setCookie(“name”,”hayden”);
alert(getCookie(“name”));
//如果需要设定自定义过期时间
//那么把上面的setCookie 函数换成下面两个函数就ok;
//程序代码
function setCookie(name,value,time)
{
var strsec = getsec(time);
var exp = new Date();
exp.setTime(exp.getTime() + strsec*1);
document.cookie = name + “=”+ escape (value) + “;expires=” + exp.toGMTString();
}
function getsec(str)
{
alert(str);
var str1=str.substring(1,str.length)*1;
var str2=str.substring(0,1);
if (str2==”s”)
{
return str1*1000;
}
else if (str2==”h”)
{
return str1*60*60*1000;
}
else if (str2==”d”)
{
return str1*24*60*60*1000;
}
}
//这是有设定过期时间的使用示例:
//s20是代表20秒
//h是指小时,如12小时则是:h12
//d是天数,30天则:d30
setCookie(“name”,”aaron”,”s20″);
It’s very trouble-free to find out any topic on web as compared to textbooks, as I found this piece of writing at this web site.
I simply want to tell you that I’m very new to blogs and truly liked this page. Likely I’m likely to bookmark your blog . You amazingly come with outstanding writings. With thanks for sharing your web-site.
This site was… how do I say it? Relevant!!
Finally I’ve found something that helped me.
Thank you!
I simply want to mention I’m beginner to blogging and certainly loved your page. Likely I’m going to bookmark your blog . You certainly have very good well written articles. Bless you for sharing with us your web page.
I simply want to mention I am new to blogging and seriously enjoyed this web blog. Likely I’m likely to bookmark your website . You really have awesome articles. Appreciate it for revealing your blog site.
I am sure this piece of writing has touched all the internet people,
its really really nice paragraph on building up new webpage.
Hi! I realize this is kind of off-topic however I needed to ask.
Does running a well-established blog like yours require a lot of work?
I’m completely new to running a blog but I do write in my journal on a
daily basis. I’d like to start a blog so I will be able to share my personal experience and feelings
online. Please let me know if you have any recommendations
or tips for new aspiring blog owners. Thankyou!
I really like it when individuals get together and share
ideas. Great site, continue the good work!
Although web sites we backlink to below are considerably not connected to ours, we really feel they’re in fact really worth a go as a result of, so possess a look.
Hi there very cool blog!! Guy .. Excellent .. Superb ..
I will bookmark your site and take the feeds additionally?
I am satisfied to find numerous helpful information right here in the post, we need develop more
techniques on this regard, thank you for sharing. . . . . .
Ahaa, its good dialogue concerning this paragraph at this place at this
webpage, I have read all that, so now me also commenting here.
I simply want to mention I am just all new to blogging and site-building and really liked this website. Likely I’m planning to bookmark your website . You definitely come with amazing articles. Bless you for sharing your web site.
Hi there, after reading this amazing paragraph i am also
cheerful to share my familiarity here with mates.
Greetings! Very helpful advice in this particular post!
before.
This kind of clever work and coverage!
and also with the layout on your blog.
Hola! I’ve been following your web site for
Saved as a favorite, I really like {your blog|your site|your web site|your
write-up and also the rest of the website is extremely good.
I’ve read this post and if I could I wish to suggest you few interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!|
here. Any way keep up wrinting.|
I’ve read this post and if I could I want to suggest you few interesting things or suggestions. Maybe you can write next articles referring to this article. I want to read more things about it!|
There’s definately a great deal to find out about
I am sure this article has touched all the
Could you make a list all of your community
find It truly useful & it helped me out
Nice blog here! Additionally your site lots up very fast! What web host are you the use of? Can I get your associate hyperlink on your host? I want my web site loaded up as fast as yours lol
Excellent blog! Do you have any tips for aspiring writers? I’m planning to start my own blog soon but I’m a little lost on everything. Would you recommend starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m totally confused .. Any suggestions? Many thanks!|
Hello there! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My website looks weird when viewing from my iphone 4. I’m trying to find a template or plugin that might be able to fix this problem. If you have any recommendations, please share. Cheers!|