How To Use jQuery with CDN?

The jQuery is a popular JavaScript library used in a lot of different Web Applications. jQuery can be used via Content Delivery Networks or CDN’s without downloading and providing it via the web application server. Popular CDN’s provides jQuery with different versions. The most important advantage of the CDN is the speed where multiple servers located worldwide can provide faster access to the jQuery library by using the nearest CDN location.

Advantages of jQuery CDN

By using jQuery with a CDN there are some advantages like below.

  • Faster web page load time with the nearist and fastest CDN.
  • Better user experience with faster load time.
  • Reliable by using multiple servers for a CDN.
  • Less load for the applications server by providing jQuery with CDN not with the web server resources.

jQuery CDN

The first choice for jQuery is using its own CDN. The own CDN of jQuery provides most of the versions of the jQuery which is more than other CDN’s. The jQuery CDN is provided via the https://code.jquery.com/ .

jQuery 3.x CDN :

<head>
    <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
</head>

Minified jQuery 3.x CDN:

<head>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>

Slim jQuery 3.x CDN:

<head>
    <script src="https://code.jquery.com/jquery-3.6.0.slim.js"></script>
</head>

Slim and Minified jQuery 3.x CDN:

<head>
    <script src="https://code.jquery.com/jquery-3.6.0.slim.min.js"></script>
</head>

Google CDN for jQuery

Google is another popular CDN for the jQuery library. Google provides jQuery via ajax.google.com .

Google CDN for jQuery 3.x :

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.js">
    </script>
</head>

Google CDN for Minified jQuery 3.x :

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js">
    </script>
</head>

Google CDN for Slim jQuery 3.x :

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.slim.js">
    </script>
</head>

Google CDN for Slim and Minified jQuery 3.x :

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.slim.min.js">
    </script>
</head>

Microsoft CDN for jQuery

Microsoft is another CDN for jQuery. Microsoft provides the jQuery library via ajax.aspnetcdn.com . More details, older versions of information can be get via the following link.

https://docs.microsoft.com/en-us/aspnet/ajax/cdn/overview

Google CDN for jQuery 3.x :

<head>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery3.60.js">
    </script>
</head>

Google CDN for Minified jQuery 3.x :

<head>
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.0.min.js">
    </script>
</head>

Google CDN for Slim jQuery 3.x :

<head>
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.0.slim.js">
    </script>
</head>

Google CDN for Slim and Minified jQuery 3.x :

<head>
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.0.slim.min.js">
    </script>
</head>

Leave a Comment