function getCookie(b) { var d = b + "="; var e = document.cookie.indexOf(d); if (e == -1) { return null; } var a = document.cookie.indexOf(";", e + d.length); if (a == -1) { a = document.cookie.length; } var c = document.cookie.substring(e + d.length, a); //乱码 //return unescape(c); // 解决乱码问题 return decodeURI(c); }