jQuery coding tutorial


 Complete jQuery Tutorials for Beginners

 


 Selector    Events     Effects    Plugins

 

 jQuery Introduction

 

Table of Contents

  1. Overview:

  2. What you should know?

  3. What you need?

  4. How to Begin?

  5. How to Install


Overview:

jQuery is a JavaScript library. It is a  framework.  This library provides you inbuilt functions which are  developed using JavaScript. jQuery allows you to add various features to  your web pages.  You can add  slideshows, galleries, widgets and many more to your website. jQuery enhances the user experience of the site. jQuery is an open source library. To use it, you don't need to buy it. There are  tons of jQuery plugins available online at free of cost. You can integrate them to your website and  extend the website functionality. This is not only increase performance of the website, but also makes it ease of use.
 
There are different types of jQuery libraries.
  • jQuery Core
  • jQuery UI
  • jQuery Mobile

 

 MenuTop

What you should know?

  • HTML
  • CSS
  • JavaScript

 What you need?

 Text editor and jQuery.

 How to Begin?

In this tutorial, straight away, I am going to  show you how to get start with jQuery.

Before writing the code in jQuery, you need to include jQuery library in your program.

There are different ways to include it.

1. Download from  jQuery.com,  and include it, in your HTML code.

2. Include CDN link 

CDN(Content Delivery Network) Link:

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

 

 TopMenu

jQuery Installation: If you are not using internet, then you need to install it in local machine.

1. Create a project folder:  sampleproject.

2. Create another folder with the name: js inside the sampleproject.

3. Go to jquery.com click the link (marked), as shown in the picture.

 Menu↑

It opens a page with  full of  code on it. You just save it in a sampleproject\js folder with name: jquery.min.js.

 


 4. Create hello.html file  in sampleproject.


hello.html

<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js"></script> 
 
<script>
 
$(document).ready(function(){
alert("Hello");
});
 
</script>
</head>
<body>
<h2>jQuery Tutorial</h2>
</body>
</html>
 
 

 
 

 5. Open it in a browser.

  Result:


 

If you got the result, it means everything is up and running. In case feeling difficult in  setting up environment, then follow method-2. 

 

 Goto Menu

 

Method-2: 

 

Using CDN link.

 

Replace hello.html with code given below and refresh the browser.

hello.html

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

<script>

$(document).ready(function(){
alert("Hello");
});

 
</script>
</head>
<body>
<h2>jQuery Tutorial</h2>
</body>
</html>

Make sure you are connected to Internet and then run this code, 

Result is same as above program. 

 Main Menu

 Move to Menu

You can run these program on any online compler. 

Just copy and paste the any of above program and click on Run button to see the result.

 you can use:  W3School Fron-end Editor.

Example:

coding-zon-jq-editor
coding-zon-jq-editor2






 

 

Here in the above example when HTML document completely loaded, jQuery code get executed automatically  prints the hello message in alert box.



 

Hopes this tutorial helped you to work with jQuery.


Please comment below if any questions you have.

Thanks for reading.


 

 

 

 

Comments

Popular posts from this blog

Using javascript pass form variables to iframe src

Creating a new PDF by Merging PDF documents using TCPDF

Import excel file into mysql in PHP