Ajax

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
*****************************************************

onreadystatechange
readyState
responseText
responseXML
status
statusText

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 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 …

ViralPatel

http://www.viralpatel.info

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s