Saturday, August 23, 2008

Get Cookie value


function getCookie(cookie) {
var reg = new RegExp("(?:^|\\s+)" + cookie + "=(.+?)(?:;|$)", "i");
var match = document.cookie.match(reg);
// if (match) return RegExp.$1;
if (match) return match[1];
}

No comments :