October 2006
Intermediate to advanced
288 pages
5h 55m
English
When we create the callback method for the request, we will need to check the ready state of the response in order to know that it is completed and ready to be parsed. In order to check the ready state with our engine, we will call our first Ajax method named checkReadyState. Following is a snippet of our onResponse method, which will make this call:
function onResponse()
{
if(Ajax.checkReadyState('loading') == "OK")
{
// Parse response here
}
}After the ready state of the response is complete, we can parse the data as we did in Chapter 3. In order to parse the data, the Ajax object has another method named getResponse. This method will provide the correct data format based on the header response from the server. ...
Read now
Unlock full access