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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
<script type="text/javascript">
// script pour ecrire le cookie
function SetCookie (name, value) {
var argv=SetCookie.arguments;
var argc=SetCookie.arguments.length;
var expires=(argc > 2) ? argv[2] : null;
var path=(argc > 3) ? argv[3] : null;
var domain=(argc > 4) ? argv[4] : null;
var secure=(argc > 5) ? argv[5] : false;
document.cookie=name+"="+escape(value)+
((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
((path==null) ? "" : ("; path="+path))+
((domain==null) ? "" : ("; domain="+domain))+
((secure==true) ? "; secure" : "");
}
// script pour lire le cookie
function getCookieVal(offset) {
var endstr=document.cookie.indexOf (";", offset);
if (endstr==-1)
endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg=name+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen) {
var j=i+alen;
if (document.cookie.substring(i, j)==arg)
return getCookieVal (j);
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;}
return null;
}
SetCookie("display",document.getElementById('q3').style.display;,date_exp,therealleague.com);
// script pour le expand-collapse
appear=function(id) {
var d = document.getElementById(id);
var pathname=location.pathname;
var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var date_exp = new Date();
date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));
if (d.style.display!="none") {
d.style.display ="none";
cook=document.getElementById('q3').style.display;
alert(cook.value);
// on appelle le script et on crée le cookie avec la valeur de document.getElementById('q3').style.display
SetCookie("display",document.getElementById('q3').style.display;,date_exp,therealleague.com);
} else {
d.style.display ="inline";
cook=document.getElementById('q3').style.display;
alert(d.style.display.value);
SetCookie("display","document.getElementById('q3').style.display;",date_exp,therealleague.com);
}
}
//interface
SetCookie("display","document.getElementById('q3').style.display;",date_exp,therealleague.com);
// on l'appelle et on lit.
display=GetCookie("display");
document.write(display);
alert(display.innerHTML);
//interface
</script>
<a href="javascript:appear('q3')">héhé</a>
<div id='q3'style="display:none">lala</div></div> |
Partager