Академический Документы
Профессиональный Документы
Культура Документы
What is AJAX?
A cleaning powder
A Dutch football team
A Greek hero
A different approach to web interaction
None of the previous
All of the previous
AJAX
readyState – 5 values
0 – Uninitialized.
1 – Loading (the open() method has been called)
2 – Loaded (request has been sent)
3 – response partially arrived.
4 – Completed (data has completely arrived and the
connection has been closed)
Beware. You can only rely on readyState == 4.
(Because some events fire multiple times in different
browsers)
AJAX…XMLHttpRequest
responseXML – holds the return data from the server (if XML was sent
back)
getResponseHeader() – returns the value of a header property sent
as parameter. For instance ‘Content-type’, ‘Content-length’ etc
getResponseHeaders() – returns all header information as a string.
You need to split on “\r\n” and you end up with an array, each
element having ONE header field as ‘field:value’
AJAX…XMLHttpRequest