Skip to content

Commit

Permalink
update list with message
Browse files Browse the repository at this point in the history
  • Loading branch information
dwcares committed Apr 12, 2015
1 parent 77baaf4 commit f831531
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app.js
Expand Up @@ -11,8 +11,7 @@ io.on('connection', function(socket) {
console.log('a user is connected');

socket.on('button', function(msg) {
console.log("got button message");
console.log(msg);
io.emit('button', msg);
});

socket.on('disconnect', function() {
Expand Down
3 changes: 3 additions & 0 deletions index.html
Expand Up @@ -21,6 +21,9 @@
//socket.emit('button', "dude");
});

socket.on('button', function(msg) {
$('#messages').append($('<li>').text(msg));
});
</script>
</body>
</html>

0 comments on commit f831531

Please sign in to comment.