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.
- By downloading jQuery and use it locally (use downloaded file from your system).
- By using jQuery from various CDN (content delivery network).
By Downloading jQuery
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.
- Compressed version used for production - https://code.jquery.com/jquery-3.4.1.min.js
- Uncompressed version used for development - https://code.jquery.com/jquery-3.4.1.js
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>
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>
<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>
<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.
Comments
Post a Comment