Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   
   HTML   
   CSS   
   JAVA SCRIPT   
   JQUERY   




JQUERY - SETUP


To use JQuery, you need to download JQuery using the below:

  1. Link to a CDN

  2. Download to local system.

Link to a CDN(Content Delivery Network)


With this method, you do not have to download the JQuery file to your local system. Rather you can link the JQuery file to your code and JQuery works just fine.


Cloudflare provides a CDN that you can use.


Below is the piece of code :


Example :



<html>
   <body>  
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/JQUERY/3.3.1/jquery.min.js"> </script>
	  
      <script>
      
			$(document).ready(function () {
            	
            	document.write("Hello World")
            	
        	});
            
      </script>      
   </body>
</html>



All we have done is, included the JQuery file jquery.min.js from cloudflare.


<script src = "https://cdnjs.cloudflare.com/ajax/libs/JQUERY/3.3.1/jquery.min.js"> </script>

Download to local system


Below are the steps to download JQuery to your local system :

  1. Goto the below link and download the latest version of JQuery.

    https://jquery.com/download/
    JQuery-Setup

  2. Then right click on the button and select "Save link as..." from the menu.
    JQuery-Setup

  3. Now click on save, to save the file with name JQuery-3.7.1.min.js.
    JQuery-Setup

Running a JQuery Program in Windows OS


Let us write a Program that will print Hello World.

  1. The first thing we will do is open Notepad in Windows OS.
    JQuery-Setup

  2. Once Notepad is opened. You can type the lines of code there.

    And now, since we are trying to print Hello World. We need to write .

    Example :



    <html>
    <body>
    <script src = "JQuery-3.7.1.min.js""> </script>
    
    <script>
    
    		$(document).ready(function () {
    			
    			document.write("Hello World")
    			
    		});
    		
    </script>
    	
    </body>
    </html>
    
    

    JQuery-Setup

  3. Then save with .htm extension. Say FirstProgram.htm.
    JQuery-Setup

  4. Then locate the saved file, i.e. FirstProgram.htm, double click on it and it will be run on your default browser.
    JQuery-Setup