Skip to content

Instantly share code, notes, and snippets.

crertel

  • Houston, TX.
View GitHub Profile
@crertel
crertel / GeoChatClient
Created Oct 31, 2013
Simple example code for geo-based chatting.
View GeoChatClient
$(function(){
ws = new WebSocket("ws://localhost:8080");
ws.onmessage = function(evt) {
if ($('#chat tbody tr:first').length > 0){
$('#chat tbody tr:first').before('<tr><td>' + evt.data + '</td></tr>');
} else {
$('#chat tbody').append('<tr><td>' + evt.data + '</td></tr>');
}
};
You can’t perform that action at this time.