Skip to content

Instantly share code, notes, and snippets.

@xetorthio
Created May 29, 2010 00:53
Show Gist options
  • Save xetorthio/417931 to your computer and use it in GitHub Desktop.
Save xetorthio/417931 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
</head>
<body>
<p>Por sesión: <span id="session"></span></p>
<p>Por sitio: <span id="site"></span></p>
<script>
if (!sessionStorage.pageLoadCount)
sessionStorage.pageLoadCount = 0;
sessionStorage.pageLoadCount++;
if (!localStorage.pageLoadCount)
localStorage.pageLoadCount = 0;
localStorage.pageLoadCount++;
document.getElementById('session').textContent = sessionStorage.pageLoadCount;
document.getElementById('site').textContent = localStorage.pageLoadCount;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment