Sunday 13 December 2009

jQuery Overview

Hi Welcome to my blog!


This is my first blog on jQuery. 
 In this blog we will learn the following topics:
  • What is jQuery
  • Benefits of using jQuery
  • jQuery browser compatibility
  • Downloading and Installing jQuery, and
  • Creating a sample your first jQuery enabled page
  • jQuery features

1. What is jQuery
  • It is a free, open Javascript library
  • It simplifies the task of creating highly responsive web pages
  • It works across all modern browsers (list of browsers are listed in this blog later)
  • It abstracts away browser-specific features, allowing you to concentrate on design
  • It focuses on simplifying common scripting tasks like
             - Getting and manipulating page contents
             - Working with the modern browser event model
             - Adding sophisticated effects
  • Most modern web development scenarios involve common patterns like
            - page loads where you perform a bunch of page setup, and
            - event where you retrieve content from the page, manipulate 
              or animate the content, and put the  content back in the page
  • jQuery make these scenarios easy

2. Benefits of using jQuery

  • Leverages your existing knowledge of CSS (Cascading Style Sheet)
  • Works with sets of elements
  • Performs multiple operations on a set of elements with one line of code (known as statement chaining)
  • Hides various browser quirks (so you can concentrate on the end result)
  • Is extensible (so you can use third-party-plug-ins to perform specialized tasks, or write your own)

3. jQuery browser compatibility

  • jQuery currently compatible with all modern browsers in use today
Browser                         With with                          Known issues with
Internet Explorer             6.0 and greater                 1.0 through 5.x
Safari                            3 and greater                    1.0 through 2.1
Chrome                         1 and greater                     N/A
Firefox                           2 and greater                    1.0.x
Opera                            9 and greater                    1.0 through 8.x


4. Downloading and Installing jQuery
  • You can download the jQuery from http://jquery.com/  
  • jQuery comes in two versions: production (which is compressed and minified) and development
  • Typically, you download both versions and then use each one for its intended purpose

5. Creating a first simple jQuery enabled page
  • typically, code that you want to execute when the page is loaded is written like this:
       
         function RunOnLoad( ) {
              alert("Page loaded!");
    }
         window.onload = RunOnLoad;
  •  The on-load event only fires after all of the page content has downloaded, including images
  • It's also harder to add multiple load functions
  • jQuery provides a way to run code when the DOM of the page is ready. This is called the document.ready event
  • The document.ready event is written like this:
           $("document").ready( function ( ) {
                  alert("Page just loaded!");

     });
  • This code will now executed when the DOM has loaded, instead of waiting for all of the page content finish downloading
  • also, you can call document.ready funtion multiple times, and jQuery will chain together each one to be called in succession


6. jQuery features:
The features break down across eight major categories:
  1. Core Functionality: Implements core jQuery functions as well as commonly used utilities
  1. Selection and Traversal: Provides functions for finding content in documents and navigating among the contents of the document
  1. Manipulation and CSS: Provides functions for editing and changing documents content and working with CSS data such as positioning info
  1. Events: Simplifies working with the modern DOM events and provides common event helper functions
  1. Effects: Provides functions for creating basic animations and effects, such as hiding and showing elements and moving objects around
  1. Ajax: Provides utilities for working with Ajax, such as loading content from pages and dealing with JSON data
  1. User Interface: Provides an official plug-in with commonly used interface widgets, like slider controls, progress bars, accordions, etc
  1. Extensibility: Enables the construction of jQuery plug-ins that enhance the functionality of the base library
We will explore each of these functionality in details in my coming blogs.
So keep watching my blogs.



No comments:

Post a Comment