When we build pages with jQuery, we have two possible way of including the library.
First we can actually save the .js file in a specific folder of our web site and then include it directly.
Another way is to use the Google Libraries API deposit and get it from there.
But what if the GLA is not available? In those cases some functionality might be lost.
Here I show you how to create a proper fallback.
The code is straight and simple.
First we try to load the jQuery library from the GLA.
If it fails, we load the local copy of it.
There's not much to say about the above snippet, as you can see. The only thing you should check and change is the jsLocalPath, according to your js libraries folder path.
<script>!window.jQuery && document.write('<script src="jsLocalPath/jquery.min.js"<\/script>')</script>
As usual, please share your experience using the comments section below.