js获取cookie

 
function getCookie(name){var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
    if(arr!=null)return unescape(arr[2]);return null;}
原文地址:https://www.cnblogs.com/objectboy/p/2987754.html