User:Catpat/common.js

/** * Récupère la valeur du cookie */ function getCookieVal(name) { var cookiePos = document.cookie.indexOf(name + "="); var cookieValue = false; alert (cookiePos : " + cookiePos); if (cookiePos > -1) {    cookiePos += name.length + 1;    var endPos = document.cookie.indexOf(";", cookiePos);    if (endPos > -1)      cookieValue = document.cookie.substring(cookiePos, endPos);    else      cookieValue = document.cookie.substring(cookiePos);  }  return cookieValue; }

cok = getCookieVal('mediawikiwikiUserName'); alert (cok);