Skip to content

Instantly share code, notes, and snippets.

@knxroot
Created November 11, 2012 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knxroot/4056320 to your computer and use it in GitHub Desktop.
Save knxroot/4056320 to your computer and use it in GitHub Desktop.
HTML5:webstorage ejemplo básico
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Web Storage</title>
<script type="text/javascript">
function almacenar()
{
if (typeof(Storage)!=='undefined')
{
alert(localStorage.nombre);
alert(localStorage.length);
localStorage.setItem('nombre','Gustavo');
}
else
{
alert("el navegador no soporta Web Storage");
}
}
</script>
</head>
<body onload="almacenar();">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment