PageRenderTime 13ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/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			
12			$(document)
13			.streamOpen(function(e, event, stream) {
14				$("<p />").appendTo("body").text("Open, id: " + stream.id);
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>