A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance.
Which are the popular jQuery CDN?
Below is few popular jQuery CDNs.
- Google.
- jQuery.
- Microsoft
Advantages of CDN:
- Light weighted (minified files) therefore download faster on client side form these side.
- Reduced the load on the server.
- Most important benefit is it will be cached, if the user has visited any site which is using jQuery framework from any of these CDN.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/x.x.x/jquery.min.js"> </script>
<script type="text/javascript" src="http://code.jquery.com/jquery-x.x.x.min.js"> </script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-x.x.x.min.js"> </script>
Suggestions:
It’s always better to load the Js library from CDN, because of the above given benefits, if in some case it fails (it will never happen; only very little chances are there) then pick from local folder.
Example is like:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/x.x.x/jquery.min.js">
</script>
<script type="text/javascript">
if(typeof jQuery == 'undefined')
{
document.write(unescape("%3Cscript src='Scripts/jquery.x.x.x.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
More on jQuery
- How to Center a Popup Window on Screen
- How to hide URL in the popup window opened using window.open
- window.showModalDialog is deprecated in Edge and Chrome
- Cloning JavaScript Object with Object.create
- Set new Attribute in XML using jQuery
- DOMParser: parseFromString() method
- What is the use of attr() method in jQuery?
- What is jQuery CDN?
- Difference between $(this) and ‘this’ in jQuery
- jQuery important questions
- Checkbox validation in jQuery
- Difference between offset and position in jQuery?
- How to change the background image using jQuery?
- jQuery Methods
- jQuery Selectors
- jQuery Downloading
- jQuery History