a zip code crypto-currency system good for red ONLY

index.html 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf8" />
  5. <title>Simple localForage example</title>
  6. </head>
  7. <body>
  8. <script src="../dist/localforage.js"></script>
  9. <script>
  10. // Forcing localstorage here. Feel free to switch to other drivers :)
  11. localforage.setDriver(localforage.LOCALSTORAGE).then(function() {
  12. var key = 'STORE_KEY';
  13. // var value = 'What we save offline';
  14. var value = new Uint8Array(8);
  15. value[0] = 65
  16. // var value = undefined;
  17. var UNKNOWN_KEY = 'unknown_key';
  18. localforage.setItem(key, value, function() {
  19. console.log('Saved: ' + value);
  20. localforage.getItem(key, function(err, readValue) {
  21. console.log('Read: ', readValue);
  22. });
  23. // Since this key hasn't been set yet, we'll get a null value
  24. localforage.getItem(UNKNOWN_KEY, function(err, readValue) {
  25. console.log('Result of reading ' + UNKNOWN_KEY, readValue);
  26. });
  27. });
  28. });
  29. </script>
  30. </body>
  31. </html>