How to use jQuery


How to use jQuery ?
There are two ways to start using jQuery in your web pages. It is simple to use jQuery, You just have to download jQuery and include it in your HTML pages. You can include jQuery in two ways.
  1.  By downloading jQuery and use it locally (use downloaded file from your system).
  2. By using jQuery from various CDN (content delivery network).
Now we will lean how to use jQuery by using both ways.

By Downloading jQuery
 In this method you just have to download jQuery form jQuery.com the official website of jQuery. Once you downloaded the jQuery its simple to use, you just have to include downloaded files in your HTML Code. Now we will learn how to do that ?

Step-1   Go to jQuery.com and go to download section there. You may also click on the given link to go to jQuery download page.
Click here to go to download page - https://jquery.com/download/
Now you will see there are two versions of jQuery are available to download.
  1. Compressed version used for production - https://code.jquery.com/jquery-3.4.1.min.js
  2. Uncompressed version used for development - https://code.jquery.com/jquery-3.4.1.js
Here we will use uncompressed version of jQuery because its used for development and the code can be easily understand by us. Just click on the link given above to download Uncompressed version.
Step-2   Once you downloaded the uncompressed version of jQuery, Go to downloaded file and paste this file to your jQuery folder where you are going to put your code files.

Step-3   Include this file to your HTML head section by using script tag. Here is the syntax of doing this.
<head>
<script src = "juqery_latest.js" > </script>
</head>
Here jquery_latest.js is my downloaded file I simply renamed it.

That’s It There you go. Now start writing jQuery code. It will work. We will write our first jQuery program in next part.

By using jQuery CDN
CDN is content delivery network which provide online content. So you may use jQuery form jQuery CDN like Google CDN, MicroSoft CDN etc.

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

Microsoft CDN
<head>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script>
</head>
You Just have to copy one of the code and paste it in you HTML Head section, that’s it.


Previous Page                                                                           Next Page





Comments

Popular posts from this blog

Welcome Post