-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
34 lines (24 loc) · 701 Bytes
/
index.html
File metadata and controls
34 lines (24 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<html>
<head>
<title></title>
<script src="socket.io/socket.io.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
</head>
<body>
<div id="local-tweet-container">
<ul class="tweets" style="height: 400; overflow: scroll;"></ul>
</div>
<script type="text/javascript">
$(document).ready(function() {
var $container = $('ul.tweets'),
socket = io.connect('http://localhost:3000'),
template = $('#tweetTemplate');
socket.on('twitter', function(data) {
console.debug(data);
$('.tweets').prepend('<li>' + data.text + '</li>');
//$container.append(template.render(data));
});
});
</script>
</body>
</html>