Question: I admit it, I don't know what I'm doing.

I'm attempting to learn how to use SignalR and I'm following various samples online almost verbatim and I can't get pasted $.connection being undefined. I'm working in MVC 4.0 and trying to use either nuget-downloaded signalR js files or those from sample projects. These are my script references.

```
@Scripts.Render("~/Scripts/jquery-1.7.2.min.js")
@Scripts.Render("~/Scripts/knockout-2.0.0.js")
@Scripts.Render("~/Scripts/jquery.signalR.js")
@Scripts.Render("~/signalr/hubs")

```

The scripts seem to load - I've even put alerts at the start of them which fire, but $.connection is always undefined. 

In a bizarre turn of events, I have a different project where I'm trying to use a different jQuery library and it uses $. and that object is ALSO always undefined. 

I'm just looking for any possible explanation of what I might be doing wrong. Thanks very much in advance.

Answer: 
The reason this works is because of the order in which the javascript files are loaded. If you try and load jquery.signalR-0.5.1.js before loading jquery, then you will face the $.connection undefined because for this to register the jquery should be loaded first. In the \_Layout.cshtml template the scripts load in the order 

```
@Scripts.Render("~/bundles/jquery")

@RenderSection("scripts", required: false)

```

So inside any of your views you can load signalr under the script section and this should work fine.
This happened to me because I dynamically loaded the `~/signalr/hubs` script before loading the `jquery.signalR-1.1.4.js` script. 

When dynamically loading, no error was present, however if I took the output of `~/signalr/hubs` and pasted it into my chrome dev tools, I received an error message `VM1047:18 Uncaught Error: SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/hubs.
 at <anonymous>:18:15
 at <anonymous>:300:2`