|
Home
|
|
Indice Javascript
|
Clock
Browser
Finestre
Status Bar
Background
Calcolatrici
Grafica ed Effetti
Convertitori
Utility
Form
Menu e Link
Cookie come ti chiami?
Ricarica la pagina per il messaggio di bentornato
Usa Copia e incolla questa è la sorgente
<body> <script> <!-- Autore: Massimo Giari (webmaster@massimo61.org) --> <!-- var nomecookie="miocookie"; function getCookieVal (offsetb) { var endstrb = document.cookie.indexOf (";", offsetb); if (endstrb == -1) endstrb = document.cookie.length; return unescape(document.cookie.substring(offsetb, endstrb)); } function GetCookie (searchcookie) { var argb = searchcookie + "="; var alenb = argb.length; var clenb = document.cookie.length; var ib = 0; while (ib < clenb) { var jb = ib + alenb; if (document.cookie.substring(ib, jb) == argb) return getCookieVal (jb); ib = document.cookie.indexOf(" ", ib) + 1; if (ib == 0) break; } return null; } writecookie = GetCookie(nomecookie); if (writecookie=="" || writecookie==null){ cookie="no" } else cookie="yes"; if (cookie=="no"){ if (username == null) { var username = prompt('Scrivi il tuo nome',"");} if (username == null) { alert('Se non scrivi il tuo nome, sarai Anonimo.'); username = 'Anonimo'; } if (username == "") { alert('Se non scrivi il tuo nome, sarai Anonimo.'); username = 'Anonimo'; } } if (cookie=="no"){ nomecookie = "miocookie" pathname = location.pathname; myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/'; var largeExpDate = new Date (); var hours=largeExpDate.getMinutes(); largeExpDate.setTime(largeExpDate.getTime()+(1 * 24 * 3600 * 1000)); SetCookie(nomecookie,username,largeExpDate,myDomain); } 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" : ""); } if (cookie=="no"){ document.write('<font face=arial size=4>Benvenuto</font><font face=arial size=4 color=#0000ff> '+username+' !</font> '); }else{ if (cookie=="yes"){ document.write('<font face=arial size=4>Bentornato</font><font face=arial size=4 color=#0000ff> '+writecookie+' !</font> '); } } // --> </script> <p><center> <font face="Verdana" size="-2">Free JavaScripts da<br> <a href="http://www.massimo61.org/">Free Web Upgrade</a></font> </center><p>