JQuery Tutorial

JQuery Tutorial – Introduction to JQuery

JQuery is one of the most widely and frequently used JavaScript libraries till date. JQuery allows rapid client side web development. JQuery contains built-in methods for most of the client side functionalities. Implementing these functionalities in JavaScript needs large piece of code. To summarize, JQuery handles elements on any webpage, traverse them, react to events, create animations and implement AJAX. This JQuery tutorial is for beginners as well as for the professionals who want to revisit their JQuery knowledge.

JQuery Installation

JQuery is freely available at google code APIs. To use JQuery in your web page, simply copy and past the following code in the header section of your web page.

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

Adding above JQuery link to the webpage will make JQuery work when you are connected to the internet. In case if you want to run JQuery offline, you should download the JQuery file and use it locally as you use any ordinary JavaScript file.

How to check if JQuery is Enabled on your page

When JQuery is enabled inside a webpage, it allows user to access the ‘jQuery’ object. Simply pass this ‘jQuery’ object to ‘if’ statement. If it returns true, it means JQuery us enabled, otherwise it will return false. Have a look at the following piece of code.

<!DOCTYPE html>
<html>
<head>
    
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
    
    <script type = "text/javascript">
        if(jQuery)
            {
               alert("Congratulations JQuery Loaded"); 
            }
        else{
            alert("JQuery not enabled");
        }
      </script> 
    
</head>
    
<body>
    
    
</body>

</html>

Download Code
Run Code
Try to run the above script. You will see a pop-up message in your browser which reads ‘Congratulations JQuery Loaded’. If you do not see above message, there is some problem with your reference to JQuery library. Try to fix it by reading this article again. The “alert” is a JavaScript function which displays a message box on the screen

This tutorial merely provided an introduction to jquery. In the upcoming tutorials, we shall see actual power of Jquery and what it can do for us. Keep visiting this site.

Copyright 2005-2016 KnowledgeHills. Privacy Policy. Contact .