Jquery.signalr CDN fallback

I am using jQuery from Google CDN and flipping 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 a CDN for jquery.signalr:

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

      

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

+5


source to share


2 answers


Same as for jQuery, only instead of checking window.jQuery

now check $.signalR

.



+4


source


You can also access jquery.signalr from this link:

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



See https://github.com/SignalR/SignalR/issues/4270 for details

0


source







All Articles