Alexan
Alexan

Reputation: 8637

jquery.signalr CDN fallback

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?

Upvotes: 7

Views: 8831

Answers (2)

user8128167
user8128167

Reputation: 7706

You can also access jquery.signalr using this link:

https://unpkg.com/[email protected]/jquery.signalR.js

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

Upvotes: 0

Robbert Draaisma
Robbert Draaisma

Reputation: 463

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

Upvotes: 4

Related Questions