Use of jQuery
The jQuery library can be added to a web page with a single line of markup.
There are several ways to add jQuery to a web page. You can use the following methods:
Download the jQuery library from jquery.com
Load jQuery from CDN, such as loading jQuery from Google
There are two versions of jQuery available for download:
Production version - used in actual websites, has been streamlined and compressed.
Development version - for testing and development (uncompressed, readable code)
Both versions can be downloaded from jquery.com.
More simple to use jQuery method
If you don't want to download and store jQuery, you can also reference it via CDN (Content Distribution Network). We only need to reference jQuery from Baidu, Facebook, Sina, Google or Microsoft, and put them in <head>
Below is a CDN for major websites.
Also shoot cloud CDN:
Tip : It is not recommended to use Google CDN to get the version, because Google products are very unstable in China.
If you look at what the Google URL is - the 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, etc.), or You can also leave only the first number, then Google will return to the latest available version of the 1 series (from 1.1.0 to 1.9.9).
Note : This site instance uses Baidu jQuery CDN library.