/tags/1.1/src/main/webapp/countdown.html

http://jquery-stream.googlecode.com/ · HTML · 30 lines · 29 code · 1 blank · 0 comment · 0 complexity · 480e0b90ff64283aa315e87f55a848ad 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="./js/jquery-1.4.1.js"></script>
  7. <script type="text/javascript" src="./js/jquery.stream.js"></script>
  8. <script type="text/javascript">
  9. $(function() {
  10. $.stream("./countdown.jsp", {type: "http", reconnect: false});
  11. $(document)
  12. .streamOpen(function(e, event, stream) {
  13. $("<p />").appendTo("body").text("Open, id: " + stream.id);
  14. })
  15. .streamMessage(function(e, event) {
  16. $("<p />").appendTo("body").text(event.data);
  17. })
  18. .streamError(function() {
  19. $("<p />").appendTo("body").text("Error");
  20. })
  21. .streamClose(function() {
  22. $("<p />").appendTo("body").text("Close");
  23. });
  24. });
  25. </script>
  26. </head>
  27. <body>
  28. </body>
  29. </html>