<script src="//example.cdn.com/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="scripts/jquery.min.js"><\/script>') </script>
If it is, you can flip a switch that tells the code to use the local repositories until the service is back up.
That assumes there's a clean fail on the initial request for jQuery i.e. it returns a HTTP error.
What happens when the webserver just doesn't respond? DOM construction is just going to wait until the browser times the connection out before it starts to download the fall back (know as a 3rd Party SPOF)
The time out is 30 seconds plus so essentially the page is broken from the user perspective.
Also, I've had to work in corporate environments where they would only let VERY specific IP addresses into their network. Javascript files on Google's CDN would routinely get blocked as Google changed IP addresses.
Now I host everything myself and I haven't had an issue.
I'm curious to know if there are any drawbacks to the approach in the linked article.
[0] http://www.hanselman.com/blog/CDNsFailButYourScriptsDontHave...
[0] http://eddmann.com/posts/providing-local-js-and-css-resource...
http://encosia.com/3-reasons-why-you-should-let-google-host-...
Personally, I self-host every dependency I possibly can, specifically because I don't want my website's functionality, performance, or security to depend on a third party insofar as I possibly can.