<br> <br> <!DOCTYPE html> <br> <html> <br> <body> <br> <br> <div id="result">Chi sono</div> <br> <br> <div id="result2">Contatore</div> <br> <br> <script> <br> // Check browser support <br> if (typeof(Storage) !== "undefined") { <br> // Store <br> sessionStorage.setItem("lastname", "Paolo vb6access@hotmail.com"); <br> // Retrieve <br> document.getElementById("result").innerHTML = sessionStorage.getItem("lastname"); <br> } else { <br> document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage..."; <br> } <br> <br> <br> if (localStorage.clickcount) { <br> localStorage.clickcount = Number(localStorage.clickcount) + 1; <br> } else { <br> localStorage.clickcount = 1; <br> } <br> document.getElementById("result2").innerHTML = "Hai visitato la pagina " + <br> localStorage.clickcount + " volte !!."; <br> <br> <br> <br> </script> <br> <br> </body> <br> </html> <br> <br> |