Table of Contents
If you don’t want to host jQuery yourself, then you can include it from a CDN. Many web developers use CDNs to host their jQuery Library for quicker access and better performance.
What’s the reason to use CDNs to host jQuery?
While using the CDN, the jquery library download time will be reduced. Accordingly, it will reduce your overall website load time. It is free to use and the jquery library will already be cached in the viewer’s browser if they cvisited another webpage, which references the same jQuery library.
And the main reason is to use a CDN to increase the speed of your page and also lowering the latency.
Most Popular jQuery Min CDN Link
There are many CDN’s are out there, including ones from Google, Microsoft, CDNJS and jsDelivr. The below CDNs are also host compressed as well as uncompressed versions of jQuery releases. Here are the best JQuery CDNs, you can try any one of the following.
To load the hosted library, you have to copy and paste the below shown code in your website. Google Content Deleivery Network is the most popular jQuery CDN, where is it used by many people and therefore it will be cached already.
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> </head>
Microsoft Ajax CDN
<head> <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script> </head>
<head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.slim.min.js"></script> </head>
Load an exact version of a file:
<head> <script src="https://cdn.jsdelivr.net/npm/package@version/file></script></head>
Use a version range instead of an exact version:
<head> <script src="https://email@example.com/dist/jquery.min.js></script> </head>
<head> <script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js></script> </head>
<head> <script src="https://firstname.lastname@example.org/dist/jquery.min.js></script> </head>