What is J Query?

Jquery in detail

J Query is a small, light-weight and fast JavaScript library. It is cross-platform and supports different types of browsers. It is also referred as ?write less do more? because it takes a lot of common tasks that requires many lines of JavaScript code to accomplish, and binds them into methods that can be called with a single line of code whenever needed.

  • j Query is a small, fast and lightweight JavaScript library.
  • and jQuery is platform-independent.
  • jQuery means “write less do more”.
  • and jQuery simplifies AJAX call and DOM manipulation.

JQuery Features:

  1. HTML manipulation
  2. DOM manipulation
  3. DOM element selection
  4. CSS manipulation
  5. Effects and Animations
  6. Utilities
  7. AJAX
  8. HTML event methods
  9. JSON Parsing
  10. Extensibility through plug-ins

How to use jQuery?

There are two ways to use jQuery.

  1. Local Installation : You can download jQuery library on your local machine and include it in your HTML code.
  2. CDN Based Version : You can include jQuery library into your HTML code directly from Content Delivery Network (CDN).

Local Installation:

Example:

         Now you can include jquery library in your HTML file as follows :
<html>
   <head>
      <title>The jQuery Example</title>
      <script type = “text/javascript” src = “/jquery/jquery-2.1.3.min.js”>
      </script>
      <script type = “text/javascript”>
         $(document).ready(function() {
            document.write(“Hello, World!”);
         });
      </script>
   </head>
   <body>
      <h1>Hello</h1>
   </body>
</html>

CDN Based Version:

You can include jQuery library into your HTML code directly from Content Delivery Network (CDN). Google and Microsoft provides content deliver for the latest version.

Example:

Now let us rewrite above example using jQuery library from Google CDN.

<html>
   <head>
      <title>The jQuery Example</title>
      <script type = “text/javascript”
         src = “https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js”>
      </script>
      <script type = “text/javascript”>
         $(document).ready(function() {
            document.write(“Hello, World!”);
         });
      </script>
   </head>
   <body>
      <h1>Hello</h1>
   </body>
</html>

Recommended Posts

Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *