function GetCookie(sName)
{
//alert( document.cookie);
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
{
if (aCrumb.length > 1 )
return unescape(aCrumb[1]);
else
return "";
}
}
return null;
}
转载于:https://www.cnblogs.com/server/archive/2009/06/15/1503732.html