标签:code pre var cape ret getc regex nbsp get
在cookie中取值
function getCookie(name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); //匹配字段 if (arr = document.cookie.match(reg)) { return unescape(arr[2]); } else { return null; } }
标签:code pre var cape ret getc regex nbsp get
原文地址:https://www.cnblogs.com/XiaoyvYa/p/13424059.html