JQuery CDN Use Introduction _jquery

Source: Internet
Author: User
Tags jquery cdn

If you don't want to download and store JQuery, you can also reference it through a CDN (content distribution network).
The servers of Baidu, Google and Microsoft all have jQuery.

JQuery Baidu CDN (domestic certainly choose Baidu or Sina)
Load Address:

Not compressed:
<script src= "Http://libs.baidu.com/jquery/2.0.0/jquery.js" ></script>

Compression:
<script src= "Http://libs.baidu.com/jquery/2.0.0/jquery.min.js" ></script>

Supported versions: 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.10.2, 1.10.1, 1.10.0, 1.9.1, 1.9.0, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.2, 1.7.1, 1.7.0, 1.6.4, 1.6.3, 1.6.2, 1.6.1, 1.6.0, 1.5.2, 1.5.1, 1.5.0, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.2, 1.3.1, 1.3.0, 1.2.6, 1.2 .3

To quote jQuery from Google or Microsoft, use one of the following codes:

Google CDN:

Copy Code code as follows:

<script src= "Http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" >
</script>


Copy Code code as follows:

Http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js


Give it a shot yourself.

Tips: Get the latest available version via Google CDN:

If you observe what the Google URL is-a jQuery version (1.8.0) is specified in the URL. If you want to use the latest version of JQuery, you can also remove a number from the end of the version string (such as this example 1.8), and Google will return the latest available version of the 1.8 series (1.8.0, 1.8.1, and so on), or you can have only the first number, then Google will return 1 The latest available version (from 1.1.0 to 1.10.2) in the series.
Microsoft CDN:
Copy Code code as follows:

<script src= "Http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js" >
</script>

Give it a shot yourself.

Tips: Using Google or Microsoft's jQuery has a big advantage:

Many users have already loaded jQuery from Google or Microsoft when they visit other sites. All the results are that when they visit your site, JQuery is loaded from the cache, which can reduce the load time. At the same time, most CDN ensures that when a user requests a file, it returns a response from a server closest to the user, which can also increase the load speed.

several CDN acceleration points in jquery

Google jquery CDN Acceleration Point
Http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js

Microsoft jquery CDN Acceleration Point
Http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.min.js

Sina jquery CDN Acceleration Point

Http://lib.sinaapp.com/js/jquery/1.10.2/jquery-1.10.2.min.js

You can also write this, the first choice, if the load failed JS will load the second address

Copy Code code as follows:

<script type= "Text/javascript" src= "Http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" >< /script>
<script type= "Text/javascript" >
!window.jquery && document.write (' <script src= ' http://lib.sinaapp.com/js/jquery/1.10.2/ Jquery-1.10.2.min.js "><\/script>");
</script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.