CDN to host jQuery
Officially there are two ways of using jQuery:
- Local Installation - You can download jQuery library on your local machine and include it in your HTML code.
- CDN Based Version - You can include jQuery library into your HTML code directly from Content Delivery Network (CDN).
There are two versions of jQuery available for downloading:
- Production version - this is for your live website because it has been minified and compressed.
- Development version - this is for testing and development (uncompressed and readable code).
The uncompressed file is best used during development or debugging; the compressed file saves bandwidth and improves performance in production. Both versions can be downloaded from jQuery.com .
CDN Based Version
Alternatively you can use a content delivery network (CDN) to deliver your jQuery. Both Google and Microsoft host jQuery. Using a content delivery network (CDN) can help improve performance of your jQuery (and website as a whole). When to use jQuery from Google or Microsoft, use one of the following:
FullSource using Google CDN
CDN for jQuery has many advantages. The foremost is the speed because CDN is made for speed only. So jQuery gets downloaded very fast from CDN, in this case making your website to load faster by a few milliseconds .