/trunk/src/main/webapp/example/countdown.html

http://jquery-stream.googlecode.com/ · HTML · 32 lines · 30 code · 2 blank · 0 comment · 0 complexity · 7220033f7a6b707fc170ff497883fdba MD5 · raw file

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Countdown</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript" src="../jquery.js"></script>
  7. <script type="text/javascript" src="../jquery.stream.js"></script>
  8. <script type="text/javascript">
  9. $.stream.setup({enableXDR: true});
  10. $(function() {
  11. $.stream("countdown.jsp", {type: "http", reconnect: false});
  12. $(document)
  13. .streamOpen(function(e) {
  14. $("<p />").appendTo("body").text("Open");
  15. })
  16. .streamMessage(function(e, event) {
  17. $("<p />").appendTo("body").text(event.data);
  18. })
  19. .streamError(function() {
  20. $("<p />").appendTo("body").text("Error");
  21. })
  22. .streamClose(function() {
  23. $("<p />").appendTo("body").text("Close");
  24. });
  25. });
  26. </script>
  27. </head>
  28. <body>
  29. </body>
  30. </html>