Skip to content

Commit 2ebf016

Browse files
committed
获取cookie值
1 parent 7b1aff0 commit 2ebf016

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

getCookie.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @description 获取cookie值
3+
* @author 未知
4+
*/
5+
6+
function getCookie(name) {
7+
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
8+
if (arr != null) return unescape(arr[2]);
9+
return null
10+
}

0 commit comments

Comments
 (0)