I use to think Ajax is very difficult, but as and when I dived into it, I realized its way too simple.
This is a small summary of Ajax from one of my presentation
So what is Ajax?
Ajax is not a new technology but a New technique for creating better, faster and interactive applications
The next question, how Ajax works?
The XMLHttpRequest object have 3 properties onreadystatechange property , readyState property , responseText property.
onreadystatechange property – stores the function that will process the response from a server
readyState property – readyState property holds the status of the server’s response.
responseText property – The data sent back from a server can be retrieved with the responseText property.
Next question is how do we send response to the server?
This is done through 2 methods of XMLHttpRequest object, open and send.
open() method takes three arguments The first argument defines which method to use when sending the request (GET or POST). The second argument specifies the URL of the server-side script. The third argument specifies that the request should be handled asynchronously.
Send() method sends the request off to the server.