Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbruno/5a0241389e477aade5d5 to your computer and use it in GitHub Desktop.
Save elbruno/5a0241389e477aade5d5 to your computer and use it in GitHub Desktop.
ElBruno - SignalR Html Client On Connected On Hub III
<script type="text/javascript">
var hub;
$(window).ready(function () {
console.log("windows ready para SignalR");
hub = $.connection.SampleHub;
// dummy call to force the [OnConnected()] method on signalR hub
hub.client.foo = function () { };
$.connection.hub.start().done(
function () {
var area = 'default';
console.log("hub started, area:" + area);
hub.server.JoinToArea(area);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment