From the course: Building Real-Time Web Apps with SignalR 2

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Clients

Clients

From the course: Building Real-Time Web Apps with SignalR 2

Start my 1-month free trial

Clients

- [Narrator] Now we have an understanding of what a SignalR hub is on the service side, let's take a look at the Client side component. SignalR provides a JavaScript library that allows users of your site to connect to hubs on your server. You do this by creating a SignalR Client, let's start by taking a look at a simple SignalR Client, we'll go through it line by line. So this is an example of some JavaScript code that runs in your page, it usually executes when your page first loads; the first thing you might notice on this first line here is the dollar symbol, that's jQuery. The SignalR Client is actually a jQuery plugin so it's important to make sure you include jQuery in your app as well. Starting at the first line here, first we create a reference to our hub called ChatHub, this references a hub class from our service side code like we saw in the last video. Notice the first letter is lowercase, also called camelCase, this is a convention throughout SignalR which can be the…

Contents