/trunk/src/main/webapp/example/countdown.html
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 11 $(function() { 12 $.stream("countdown.jsp", {type: "http", reconnect: false}); 13 14 $(document) 15 .streamOpen(function(e) { 16 $("<p />").appendTo("body").text("Open"); 17 }) 18 .streamMessage(function(e, event) { 19 $("<p />").appendTo("body").text(event.data); 20 }) 21 .streamError(function() { 22 $("<p />").appendTo("body").text("Error"); 23 }) 24 .streamClose(function() { 25 $("<p />").appendTo("body").text("Close"); 26 }); 27 }); 28 </script> 29 </head> 30 <body> 31 </body> 32</html>