1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
function historique ( his )
{
his=document.referrer;
function VerCookie(cook_his)
{
var search = cook_his + "="
if (document.cookie.length > 0)
{ // si il existe au moins un cookie
offset = document.cookie.indexOf(search)
if (offset != -1)
{ // si le cookie recherché existe
function GetCookie(cook_his)
{
var startIndex = document.cookie.indexOf(cook_his);
if (startIndex != -1)
{
var endIndex = document.cookie.indexOf(";", startIndex);
if (endIndex == -1) endIndex = document.cookie.length;
return unescape(document.cookie.substring(startIndex+cook_his.length+1, endIndex));
}
else
{
return null;
}
}
return offset
}
else
{ //le cookie n'existe pas
function SetCookie(cook_his, his, 1)
{
var expire = new Date ();
expire.setTime (expire.getTime() + (24 * 60 * 60 * 1000) * 1);
document.cookie = cook_his + "=" + escape(his) + "; expires=" +expire.toGMTString();
//*******Ici, il faudrait que je parvienne à remplacer la valeur de la variable his par celle du cookie.*****//
}
}
return -1
}
}
}
function del_cook( cook_his )
{
var expire = new Date ();
expire.setTime (expire.getTime() - (24 * 60 * 60 * 1000));
document.cookie = cook_his + "=; expires=" + expire.toGMTString();
} |
Partager