/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
- <!DOCTYPE html>
- <html>
- <head>
- <title>Countdown</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script type="text/javascript" src="./js/jquery-1.4.1.js"></script>
- <script type="text/javascript" src="./js/jquery.stream.js"></script>
- <script type="text/javascript">
- $(function() {
- $.stream("./countdown.jsp", {type: "http", reconnect: false});
-
- $(document)
- .streamOpen(function(e, event, stream) {
- $("<p />").appendTo("body").text("Open, id: " + stream.id);
- })
- .streamMessage(function(e, event) {
- $("<p />").appendTo("body").text(event.data);
- })
- .streamError(function() {
- $("<p />").appendTo("body").text("Error");
- })
- .streamClose(function() {
- $("<p />").appendTo("body").text("Close");
- });
- });
- </script>
- </head>
- <body>
- </body>
- </html>