How to link jQuery from CDN
Officially there are two ways of using jQuery:
- CDN Based Version - You can include jQuery library into your HTML code directly from Content Delivery Network (CDN).
- Local Installation - You can download jQuery library on your local machine and include it in your HTML code.
CDN Based Version
A Content Delivery Network (CDN), also known as a Content Distribution Network, comprises a network of proxy servers distributed globally in various geographical locations. These servers store cached content, allowing end users to efficiently access it. Notably, major technology companies like Google and Microsoft provide hosted copies of jQuery libraries via their CDNs. Employing a CDN can significantly enhance the performance of both your jQuery library and your entire website. To incorporate a hosted jQuery library, you simply need to insert the corresponding HTML code snippet provided below into your HTML page.
Using a CDN for jQuery yields numerous benefits, foremost among them being the substantial enhancement in loading speed. CDNs are carefully designed for accelerated loading, leading to swift downloads of the jQuery library from the Content Delivery Network. As a result, your web pages experience a noticeable acceleration in loading times, even if it's a matter of mere milliseconds.
There are two versions of jQuery libraries accessible for downloading from websites:
- 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 version is preferable during programming or debugging; the compressed version saves bandwidth and boost performance in production level. Both versions can be downloaded from jQuery.com web-site.