Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (33 sloc) 1.32 KB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
Quote Stream
</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js"></script>
<script type="text/javascript" src="http://localhost:4000/socket.io/socket.io.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function() {
var ticker = location.hash.substr(1);
var socket = io.connect("http://localhost:4000");
socket.emit('ticker', ticker);
socket.on('quote', function(data) {
var data = $("<pre>" + data + "</pre><hr />");
$("#quotes").append(data);
$("html, body").animate({ scrollTop: $(document).height() }, 100);
$(data).show("slide", { direction: "up" }, 250);
$(data).effect("highlight", {}, 1500);
});
$(window).on('hashchange', function() {
var ticker = location.hash.substr(1);
socket.emit('ticker', ticker);
});
});
</script>
<body>
<div id="quotes"></div>
</body>
</html>
Something went wrong with that request. Please try again.