[BOM]前端解析cookie为对象
参考解析页面传参
var cookie_str = document.cookie var cookie_arr = cookie_str.split("; ") var cookie_obj = {} for (var i = 0; i < cookie_arr.length; i++) { cookie_obj[cookie_arr[i].split("=")[0]] = cookie_arr[i].split("=")[1] }
这里不使用cookie_obj[cookie_arr[i].split("=")[0]] = unescape(cookie_arr[i].split("=")[1]);