websocket test init

This commit is contained in:
Luigi Maselli committed 2013-06-30 23:59:06 +02:00
1 parent de906a22aa
commit 4d77b668b4
8 files changed
+127

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
<html>
<head>
<title>Websocket demo Socket.io</title>
<script src="./socket.io/socket.io.js"></script>
<script src="./jquery.min.js"></script>
</head>
<body>
<script>
$(document).ready(function () {
var socket = io.connect( window.location.origin ); // transparent HTTP / Websocket upgrade
socket.on('new value', function (data) {
console.log("RECV:"+ JSON.stringify(data));
$('#display').html(data.val);
});
});
</script>
{{{body}}}
</body>
</html>