i am trying to connect to a signalr hub which is in another domain from javascript client.
my references in the page
`<script src="script/jquery-1.10.2.min.js"></script>
<script src="script/jquery.mobile-1.4.3.min.js"></script>
<script src="Scripts/jquery.signalR-2.1.2.min.js"></script>
<script src="http://domain/SignalR/Hubs"></script>
<script type="text/javascript">
$(function () {
var myHub = $.connection.newHub;
// Start the connection
$.connection.hub.start();
// Declare a function on the blog hub so the server can invoke it
myHub.client.BroadcastMessage= function ( message) {
alert(message);
};
myHub.server.SentInfo(" message");
}
but the client fails to connect to hub.
$.connection.hub.start();
fails and in console if i try to invoke myHub.server.SentInfo(" message");
it gives error as
Error: SignalR: Connection must be started before data can be sent. Call .start() before .send()
What am i missing.
Thanks in advance