function getCookie(name) { var cookies = window.top.document.cookie.split(‘; ‘);//分号后面有个空格 for (var i = 0; i < cookies.length; i++) { var arr2 = cookies[i].split(‘=‘); alert(name == arr2[0]); alert(arr2); if (arr2[0] == name) { return arr2[1]; } } return ‘‘; }
分号后面有个空格!!!!!!!!