Skip to content

Instantly share code, notes, and snippets.

@Lexicality
Forked from solexious/gist:5f1f3b29aa3fe51ca3d8
Last active January 24, 2016 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lexicality/8e2c5479944816ad141c to your computer and use it in GitHub Desktop.
Save Lexicality/8e2c5479944816ad141c to your computer and use it in GitHub Desktop.
socket.on('chat message', function(msg){
var id = msg.mac.replace(/:/g, '-');
console.info("Got a message with id '%s': %o", id, msg);
if (!$('#' + id).length) {
$('#messages').append($('<li>', { id: id, text: msg.mac }));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment