Jquery

Jquery : Benefits, Examples

Directly taken from the website of jQuery -” jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages”.It is basically a JavaScript framework for writing huge task of JavaScript with few lines of code.

What are the benefits of jQuery?

1) 5 lines of code of jQuery can perform better task than 25 lines of traditional Javascript code.
2) Various number of plugins are available and a large community support this project it is better to use jQuery in your project compared to other JavaScript frameworks like prototype.js or moottools .
3) jQuery’s website contains very good documentation with useful examples.
4) It simplifies the Ajax Development. Just have to write 5 or 6 lines to call the Ajax. Isn’t that easy??

Well these are just few benefits of jQuery but if you start using jQuery then you’ll come to know about the actual benefits of using jQuery. And believe me, It worth using jQuery in your web applications otherwise just blame me.

Basic Examples of jQuery :

$(document).ready(function()
{
    $(".button").click(function ()
    {
      $("p").hide("slow");
    });
});

In the above example, when a element with class “button” is clicked, all the paragraph element (”p”) will be hidden in the whole document in slow movement i.e. with slight animation.

$(document).ready(function()
{
      $("#divid").load("sample.php");
});

Above is the example Ajax using jQuery, look how simple it is to use ajax using jquery.The response got from the sample.php file is filled inside the element whose id is “divid”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.