What is JQuery? Why should I use it?

0 votes
asked Jun 16, 2013 in JQuery by anonymous

So far I worked mostly on windows based applications in Microsoft technologies and I am now wanted to move into web technologies. I heard the word JQuery in lot of places when my friends talked, also in internet. So, I am really curious to know what is JQuery and why should use it? Is it easy to learn? Any good link out there to know what is inside jquery?

Share

1 Answer

+1 vote
answered Jun 17, 2013 by Aadhira (1,213 points)
selected Jun 18, 2013 by administrator
 
Best answer

JQuery is nothing but a Java Script library which helps to write the java script quick and productive. It provides following advantages.

  1. Lot of short cuts for existing java script functions. Very less typing.
    Example: $('a') ---> This will give as all the 'anchor' tags in the html dom object

  2. Provide lots of additional functions to write the productive code.
    Example: $('div.MyStyle') --> This line will find all 'div' tags which are using the css class 'MyStyle'

  3. JQuery helps to reduce the issues to deal with the Cross Browser Support. Because some, function of Javascript works on one browser and the same may not work on the other.
    Example: InnerText property may work in Internet explorer very well but may not be good for FireFox or other browsers.

  4. JQuery provide thousands of plugins to be used in any application for free.

  5. For a same type of function, you may be using different function based on the tag you are dealing with but in JQuery it is going to be single method, and the JQuery library will do the background work to get the right result for you.

    Example: Consider, you have 'Textbox' and 'Select'. For a texbox if you want to get value of that textbox, then you may get it from value property.
    But to get the value of selected item from the dropdown box, in regular javascript, you want to find the selected index, then get the options collection and then ge the text using that index.
    But in JQuery, you may use single function called 'val()', either it is textbox or combobox. But you will get the result you need.

    $('input[type="text"], #selectTagId ').val() --> this wil return value of all input elements with the type text and the value of tag with id "selectTagId" (you can use any value for the Id).

  6. Apart from every thing, it is free.

It is really very easy if you understand the basics. If you want, you can go through the following link to get better idea.

http://jquery.com/

Your answer

Preview

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
site design / logo / content © 2013 - 2015 pinfaq.com
...