Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: AJAX
PostPosted: Wed Aug 22, 2007 5:50 pm 

Joined: Mon Mar 28, 2005 4:39 am
Posts: 6540

Q: Is AJAX a programming language?
A: No

Q: What is AJAX?
A: In one sense, AJAX is simply an acronym for "Asynchronous JavaScript And XML"
In another, it is a protocol for sending requests from a client (web page) to a server,
and how the information is / should be communicated between the client and the

Q: How new is AJAX?
A: The terminology is new, but the techniques are not.

Q: Why can/should AJAX be used?
A: AJAX is best suited for small (hopefully unobtrusive) updates to the current
web page, based on information that is not available until it has been provided
by the end user.

Q: When should AJAX NOT be used?
A: See above

Q: What objects are used by AJAX programs?
A: See above

Q: Describe the formats and protocols used/specified by AJAX
A: The client web page is responsible for creating the XmlHttpRequest,
and therefore the connection from the web page to some application
on the server.
Part of this connection identifies how the response can / should be
provided to the client code - via the use of a "callback" routine.
The callback routine is invoked multiple times with a status code,
indicating the reason for the invocation.
If the request can be successfully completed by the server application,
a responce should also be provided.

Q: Describe some things that can't be done with AJAX
A: Sending a request to a server outside of the domain from which
the web page originated.

Q: How should AJAX objects be created?
A: In a browser general manner, if at all possible.

Q: For what error conditions should programs check?
A: The connection can not be established
The request does not complete in a timely fashion
Unexpected response

Q: Are Finite State Machines (FSM's) appropriate for use with AJAX?
A: Possibly
There are circumstances under which an FSM might be appropriate.
It depends upon the complexity of the environment, and the number
of machines that might need to be contacted in order to obtain the
response to the request.

Q: Identify and describe the state transitions that can/should occur within a transaction
A: - Reset : When the XmlHttpRequest object is created, no connection yet exists between the clent, and the server.
Open : When the is issued, the request is being prepared for transmission to the server
Sent : When the xmlHttp.send() is issued, the request is transmitted to the server application
Rcvd : When the xmlHttp callback routine is called, the readyState and status fields of the object define why the routine was called

Q: What values exists for the XmlHttpRequest.readyState field, and what do they mean?
A: readyState values:
0 = uninitialized
1 = loading
2 = loaded
3 = interactive
4 = complete

Q: When is it appropriate to access, or use the other fields within the XmlHttpRequest object?
A: The most important field is the readyState field. Once a value of 4 (i.e., complete) is received,
then the next most important field is status. The value of status will be the same as the
HTTP Status Code values as documented here:
back to top

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group