Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/11/2011, 14:13
PercevalCiro
 
Fecha de Ingreso: junio-2009
Mensajes: 64
Antigüedad: 14 años, 10 meses
Puntos: 6
Respuesta: API HTML5 JavaScript

Wow--- buenisimo...

Me quede encantado con localStorage...

Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.   <head>
  3.     <title>html5</title>
  4.    <script  type="text/javascript">
  5.           function apertura(){
  6.  
  7. var textarea = document.getElementById("asd");
  8. textarea.focus();
  9.  
  10. textarea.addEventListener('keyup', function(){
  11.         window.localStorage['value'] = textarea.value;
  12.         window.localStorage['timestamp'] = (new Date()).getTime();
  13. }, false);
  14. textarea.value = window.localStorage['value'] + window.localStorage['timestamp'];
  15.    }
  16.   </script>
  17.  
  18.   </head>
  19.   <body onload="apertura();">
  20.  
  21.    <textarea id="asd" rows="30" cols="100"></textarea>
  22.    
  23.   </body>
  24. </html>