10 lines
No EOL
329 B
JavaScript
10 lines
No EOL
329 B
JavaScript
function getCookie(name) {
|
|
nom = name + "=";
|
|
let liste = document.cookie.split (';');
|
|
for (let i = 0; i < liste.length; i++) {
|
|
let c = liste[i];
|
|
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
if (c.indexOf(nom) == 0) return c.substring(nom.length, c.length);
|
|
}
|
|
return null;
|
|
} |