Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<script src="Scripts/jquery-1.6.4.min.js"></script>
<script src="Scripts/jquery.signalR-2.2.0.min.js"></script>
<script src="signalr/hubs"></script>
<script type="text/javascript">
$(function () {
$.connection.hub.url = "/signalr";
var chat = $.connection.chatHub;
chat.client.addMessage = function (message) {
$('#messages').append($('<li>').text(message));
};
$('#send-button').click(function () {
var message = $('#text-message').val();
chat.server.send(message);
$('#text-message').val("")
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment