Introduction to jQuery cdn

Source: Internet
Author: User

If you do not want to download and store jQuery, you can also reference it through CDN.
Google and Microsoft servers both have jQuery.

To reference jQuery from Google or Microsoft, use one of the following code:
Google CDN:Copy codeThe Code is as follows: <Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
</Script>
</Head>

Try it yourself
Prompt: Get the latest available version through Google CDN:
If you look at the Google URL-jQuery version (1.8.0) is specified in the URL ). If you want to use jQuery of the latest version, you can also delete a number from the end of the version string (for example, 1.8 in this example, google will return the latest available versions (1.8.0, 1.8.1, and so on) in the 1.8 series, or only the first number is left, then Google will return the latest available versions in Series 1 (from 1.1.0 to 1.9.9 ).
Microsoft CDN:Copy codeThe Code is as follows: <Script src = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js">
</Script>
</Head>

Try it yourself
Prompt: Using Google or Microsoft's jQuery has a great advantage:
Many users have loaded jQuery from Google or Microsoft when visiting other sites. All the results are that jQuery is loaded from the cache when they visit your site, which can reduce the loading time. At the same time, most cdns can ensure that when users request files from them, they will return a response from the server closest to the user, which can also increase the loading speed.

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.