The Best Way to Load jQuery Library (with fallback)

Here is what I think is the best and most reliable way to load jQuery library and jQuery UI Libraries. Nowadays everyone is using the Google CDN to load in the latest version of the jQuery library, this is leading to many browsers caching this file. If your web pages also do this it is very likely that the viewer already has this file cached and hence it will be one less file for them to load before getting to view your page.

On the off chance that the Google CDN is down (not likely) OR most likely you are working from a localhost for development there is a fall back to load a local version of jQuery Library.

Load jQuery Library

Load jQuery Library

Other Methods


Dynamically Load jQuery Library Using Plain JavaScript