// 获取cookie
function getCookie(name){
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if(arr = document.cookie.match(reg)){
return (arr[2]);
}else {
return null;
}
}
// 获取cookie
function getCookie(name){
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if(arr = document.cookie.match(reg)){
return (arr[2]);
}else {
return null;
}
}
本文标题:前端 cookie的获取
本文链接:https://www.haomeiwen.com/subject/efdeeqtx.html
网友评论