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

Download jQuery


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>

<head>
<script src="jquery-1.10.2.min.js"></script>
</head>
Below is a CDN for major websites.

Baidu CDN:

<head> 
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"> 
</script> 
</head>

Also shoot cloud CDN:

<head> 
<script src="http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.2.min.js"> 
</script> 
</head>

Sina CDN:

<head> 
<script src="http://lib.sinaapp.com/js/jquery/2.0.2/jquery-2.0.2.min.js"> 
</script> 
</head>

Google CDN:

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

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.

Last Updated: 2018-11-24 13:01:48 By Akshay

SHARE THIS

share_facebook share_twitter share_google_plus

Please Comment Here :