Finally got the answer. I was trying every possible thing I got on internet and then one thing worked. and that was in this line [HubName("myHub")].. I had this name as [HubName("MyHub")] before and so the error.
[HubName("myHub")]
public class MyHub : Hub
{
public void Send(string name, string message)
{
Clients.All.broadcastMessage(name, message);
}
You need to define HubName same as you used in javascript so that there wont be any confusion in getting client.
var chat = $.connection.myHub;