7

I use jQuery from Google CDN and fallback to local copy:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
    window.jQuery || document.write('<script src="Scripts/jquery-2.1.4.min.js">\x3C/script>')
</script>

But I also want to use CDN for jquery.signalr:

<script src="http://ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-2.2.0.min.js"></script>

But how I can check if I need fallback for jquery.signalr?

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
Alexan
  • 8,165
  • 14
  • 74
  • 101

2 Answers2

4

The same idea as what you do for jQuery, only instead of checking window.jQuery now check for $.signalR.

Anders
  • 8,307
  • 9
  • 56
  • 88
Robbert Draaisma
  • 463
  • 4
  • 14
0

You can also access jquery.signalr using this link:

https://unpkg.com/signalr@2.4.0/jquery.signalR.js

For details please see https://github.com/SignalR/SignalR/issues/4270

user8128167
  • 6,929
  • 6
  • 66
  • 79