标签:
//获取cookie
function getCookieValue(cookieName)
{
var cookieValue = document.cookie;
var cookieStartAt = cookieValue.indexOf(""+cookieName+"=");
if(cookieStartAt==-1)
{
cookieStartAt = cookieValue.indexOf(cookieName+"=");
}
if(cookieStartAt==-1)
{
cookieValue = null;
}
else
{
cookieStartAt = cookieValue.indexOf("=",cookieStartAt)+1;
cookieEndAt = cookieValue.indexOf(";",cookieStartAt);
if(cookieEndAt==-1)
{
cookieEndAt = cookieValue.length;
}
cookieValue = unescape(cookieValue.substring(cookieStartAt,cookieEndAt));//解码latin-1
}
return cookieValue;
}
http://blog.csdn.net/taozi165/article/details/6553544
标签:
原文地址:http://www.cnblogs.com/yzuzhang/p/5216749.html