forked from leftypol/leftypol
main.js: format getCookie
This commit is contained in:
parent
30d0b3bfe4
commit
b77685f8f4
1 changed files with 5 additions and 4 deletions
|
@ -231,11 +231,12 @@ function init_stylechooser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCookie(cookie_name) {
|
function getCookie(cookie_name) {
|
||||||
var results = document.cookie.match('(^|;) ?' + cookie_name + '=([^;]*)(;|$)');
|
let results = document.cookie.match('(^|;) ?' + cookie_name + '=([^;]*)(;|$)');
|
||||||
if (results)
|
if (results) {
|
||||||
return (unescape(results[2]));
|
return unescape(results[2]);
|
||||||
else
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue