I am trying to implement a chat module in an ASP.NET MVC 4 application based on the example here . Since this one, without using the latest version of SignalR (0.5.3), I had to configure the code to make it work.
The problem is that I couldn't even get hubConnection to work. I am facing a JS error that says:
Uncaught TypeError: Object function ( selector, context ) {
I'm not sure why there is no hubConnection method. I have the latest jQuery and SignalR libraries, and I just followed the SignalR 0.5.3 release notes here . Here is a snippet of generated code in my view:
<script src="/Scripts/jquery-1.8.2.js"></script> <script src="/Scripts/jquery.signalR-0.5.3.js"></script> <script type="text/javascript" src="/signalr/hubs"></script> <script type="text/javascript"> $(function () { var connection = $.hubConnection(); var chatHubClient = connection.createProxy("chatHub"); connection.start(function () { chatHubClient.join('TEST'); }); }); </script>
Hope someone can point me in the right direction. Thanks.
source share