a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  5. <title>EventSource test</title>
  6. </head>
  7. <body>
  8. <h1>EventSource test</h1>
  9. <ul></ul>
  10. <script type="text/javascript">
  11. var logger = document.getElementsByTagName('ul')[0],
  12. socket = new EventSource('/');
  13. var log = function(text) {
  14. logger.innerHTML += '<li>' + text + '</li>';
  15. };
  16. socket.onopen = function() {
  17. log('OPEN');
  18. };
  19. socket.onmessage = function(event) {
  20. log('MESSAGE: ' + event.data);
  21. };
  22. socket.addEventListener('update', function(event) {
  23. log('UPDATE(' + event.lastEventId + '): ' + event.data);
  24. });
  25. socket.onerror = function(event) {
  26. log('ERROR: ' + event.message);
  27. };
  28. </script>
  29. </body>
  30. </html>