Starting in SignalR 1.0, client and server methods can only be accessed through the client and server namespaces respectively. State also got it's own namespace.
This change was made to avoid collisions between client and server methods. Your JS code would change to look like this:
$(function () {
var chat = $.connection.chat;
$('#userName').val(prompt('Enter your name:', ''));
$('#groupName').val(prompt('Enter your groupName:', ''));
chat.state.userName = $('#userName').val();
chat.state.groupName = $('#groupName').val();
chat.client.addMessage = function (userName, groupName, message) {
$('#messages').append('<li><b>' + groupName + "." + userName + ":</b>" + message + '</li>');
$('#msg').val('');
};
$("#broadcast").click(function () {
chat.server.sendAll(chat.userName, chat.groupName, $('#msg').val());
});
$("#groupcast").click(function () {
chat.server.sendGroup(chat.userName, chat.groupName, $('#msg').val());
});
$.connection.hub.start().done(function () {
chat.server.join(chat.groupName); //should no longer throw exception!!!!!!!!!
});
$.connection.hub.start();
});