Friday, February 19, 2010

Introduction to jQuery

Before to start with jquery, one should have some knowledge on following,
  • Familiarity with basic programming.
  • knowledge of JavaScript.
  • editing HTML pages.
  • Some Knowledge of CSS (Selectors).

What is jQuery ?
  • jQuery is a lightweight, JavaScript library that simplifies interaction between HTML and JavaScript.
  • A framework for Client Side JavaScript.
  • Framework provide useful alternatives for common programming tasks, creating functionality which may not be available or cumbersome to use within a language.
How can it help you ?
  • jQuery makes writing JavaScript much easier.
  • Cross browser support ( IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)
  • CSS like syntax – easy for developers/non developers to understand.
  • Well documented.

jQuery syntax

$.func(..); / jQuery.func(..);
Or
$(selector).func(..); / jQuery(selector).func(..);

$ : jQuery Object, can be used instead of jQuery.
selector : Selector syntax, many different selectors allowed.
func : Chainable, most functions return a jQuery object.
(…) : Function parameters.

Three major concepts of jQuery
  • The $() function
  • Chainability
  • Get > Act