Easy Tutorial
❮ Sel Input Checkbox Html Csshooks ❯

jQuery Installation


Adding jQuery to Your Web Page

There are several ways to add jQuery to your web page. You can use the following methods:


Downloading jQuery

There are two versions of jQuery available for download:

Both versions can be downloaded from jquery.com.

The jQuery library is a JavaScript file, and you can include it using the <script> tag in your HTML:

<head>
<script src="jquery-1.10.2.min.js"></script>
</head>

Tip: Place the downloaded file in the same directory as your web page to use jQuery.

| | Are you wondering why we didn't use type="text/javascript" in the <script> tag? <br> <br>In HTML5, you don't have to do that. JavaScript is the default scripting language in HTML5 and all modern browsers! | | --- | --- |


Alternative Methods

If you don't want to download and host jQuery yourself, you can also include it from a CDN (Content Delivery Network).

Staticfile CDN, Baidu, UpYun, Sina, Google, and Microsoft all host jQuery.

If your site's users are from China, it is recommended to use a domestic CDN address like Baidu, UpYun, or Sina. If your users are from abroad, you can use Google or Microsoft.

Note: This site uses the tutorialpro.org CDN library for examples.

To include jQuery from Staticfile CDN, UpYun, Sina, Google, or Microsoft, use one of the following codes:

Staticfile CDN:

<head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
</head>

Baidu CDN:

<head>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
</script>
</head>

UpYun CDN:

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

Sina CDN:

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

Google CDN:

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

| | It is not recommended to use the Google CDN to fetch versions because Google products are unstable in China. | | --- | --- |

Microsoft CDN:

<head>
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
</head>

| | Using jQuery from Staticfile CDN, Baidu, UpYun, Sina, Google, or Microsoft has a significant advantage: <br> <br>Many users have already loaded jQuery from Baidu, UpYun, Sina, Google, or Microsoft when visiting other sites. So when they visit your site, jQuery will be loaded from cache, reducing load time. Additionally, most CDNs ensure that the file is served from the nearest server to the user, which also improves load time. | | --- | --- |


Checking jQuery Version

You can check the version of jQuery currently in use by running the $.fn.jquery command in the browser's Console window:

❮ Sel Input Checkbox Html Csshooks ❯