jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML. jQuery is an amazing JavaScript library that makes it easy to create wonderful web effects in just a few lines of code. jQuery is a new type of Javascript library. It is not a huge, bloated framework promising the best in AJAX – nor is it just a set of needlessly complex enhancements – jQuery is designed to change the way that you write Javascript.
jQuery is a Javascript library that takes this motto to heart: Writing Javascript code should be fun. jQuery achieves this goal by taking common, repetitive, tasks, stripping out all the unnecessary markup, and leaving them short, smart and understandable.
Quick Facts
• jQuery supports CSS 1-3 and basic XPath.
• jQuery is about 19kb in size.
• jQuery works in Firefox 1.0+, Internet Explorer 5.5+, Safari 1.3+, and Opera 8.5+.
• jQuery and Prototype can be used together!
• jQuery owns a strong and very flexible mechanism for adding in methods and functionality, bundled as plugins
jQuery contains the following features:
• DOM element selections using the cross-browser open source selector engine Sizzle, a spin-off out of jQuery project[3]
• DOM traversal and modification (including support for CSS 1-3 and basic XPath)
• Events
• CSS manipulation
• Effects and animations
• Ajax
• Extensibility
• Utilities – such as browser version and the each function.
• The $ function• One of the critical concepts in any jQuery code is the so called ‘$’ function. ‘$’ is actually an ‘alias’ for the ‘jQuery’ namespace.
• Example 1: jQuery provides a function for trimming strings. This function can be used as:
• str = " foo "; • jQuery.trim(str); // returns "foo" • Or, it can also be used as: • str = " foo "; • $.trim(str);
• These are equivalent. Usage of ‘$’ instead of ‘jQuery’ is an ad-hoc convention, and is considered easier[who?].
• Example 2: To select all the paragraphs that have the class ‘foo’ and add another class called ‘bar’ to all of them:
• $(“p.foo”).addClass(“bar”);
• Example 3: To execute a function ‘myfunc’ immediately after the page is loaded (called the ready handler in jQuery lingo):
• $(document).ready(function() {
• myfunc();
• });
• This is typically used in a context like this:
• $(document).ready(function() {
• // Stripe all the tables in the document using the oddStripe and evenStripe CSS classes.
• $(‘tr:nth-child(odd)’).addClass(“oddStripe”);
• $(‘tr:nth-child(even)’).addClass(“evenStripe”);
• });
For detailed information ,check this.-
http://www.jquery.com/