28 December 2005

AJAX Tutorial

AJAX :: Asynchronous Javascript And XML

AJAX is based on XMLHttpRequest

With this object we can assign actions to occur at specific properties like

Properties of XMLHttpRequest


Values for readyState :

0 = Uninitialized ; 'open' is not yet called
1 = Loading ; 'send' for request is not yer called
2 = Loaded ; 'send' is called, headers & status are available
3 = interactive ; downloading response
4 = Completed ; finished downloading response

responseText : Response as Text OR null if readyState < 3

responseXMl : Response as DOM document object OR null if readyState < 3

status : Integer HTTP status code

statusString : Status String

Methods of AJAX
Basic Methods

1) open(method, url [,async])

- initializes a new HTTP request
-method : GET, POST, PUT, DELETE
-url : http url
-async : true/false

2) send(body)

-Sends HTTP request

3) abort()

-Called after 'send' to cancel the request

Header Methods

4) void setRequestHeader(name, value)

5) String getResponseHeader(name)

6) String getAllResponseHeaders()

Enjoy AJAXing ...


Making of http://viralpatel.siteburg.com



On 11th Dec 2005 , I planned the parts of the website on paper.

On 18th Dec 2005 , I started developing different pages since 1 PM till 7 PM.

Almost completed the structure of the site & database design. I uploaded later at night & tested.

By Next week I added AJAX feature to get faster response from database.

AJAX basically uses XMLHttpRequest object available in Javascript.

Visit the site and leave some comments through mail ...


Next Blog wil contain useful information about AJAX

Bye then