fxs_2008:留个笔记了
//取得某一cookie名称的值
function getCookieValue(cName){
var strCookie=document.cookie;
if(cName){
var arrCookie=strCookie.split(";");
var cValue;
for(var i=0;i<arrCookie.length;i++){
var arr=arrCookie[i].split("=");
if(cName == arr[0]){
cValue= arr[1];
return cValue;
}
}
}else{
return strCookie;
}
}
//设置cookie
function show_hidden_properties(){
document.cookie = 'showHiddenProperties=true;path=/;';
document.location=document.location.href;
}
//重置或删除某一cookie变量
function hide_properties(){
document.cookie = 'showHiddenProperties=;path=/;';
document.location=document.location.href;
}
本文永久链接: http://www.zzxj.net/blog/fxs_2008/archive/2010/04/01/126.html
发表于 @ 2010年04月01日 |评论(loading... )|收藏