Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
a3365298cec778cf99e374ff771ffe43939e2ad3
1 parent
4ecd7a9e
function of get cookie
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
web-static/js/common.js
web-static/js/common.js
View file @
a336529
...
...
@@ -10,23 +10,11 @@ var $body = $('body');
require
(
'./footer'
);
function
cookie
(
name
)
{
var
cookies
=
document
.
cookie
,
cookieVal
,
offset
;
if
(
document
.
cookie
&&
document
.
cookie
!==
''
)
{
offset
=
cookies
.
indexOf
(
name
+
'='
);
if
(
offset
>
-
1
)
{
offset
+=
name
.
length
+
1
;
cookieVal
=
decodeURIComponent
(
$
.
trim
(
cookies
.
substring
(
offset
,
cookies
.
indexOf
(
';'
,
offset
))));
}
}
var
re
=
new
RegExp
(
name
+
'=([^;$]*)'
,
'i'
),
matchPattern
=
'$1'
;
return
cookieVal
;
return
re
.
test
(
decodeURIComponent
(
document
.
cookie
))
?
RegExp
[
matchPattern
]
:
''
;
}
function
setCookie
(
name
,
value
,
options
)
{
...
...
Please
register
or
login
to post a comment