Skip to content

Instantly share code, notes, and snippets.

@knxroot knxroot/gist:4056320

Created Nov 11, 2012
Embed
What would you like to do?
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
You can’t perform that action at this time.