The XMLHttpRequest Flashcards
The keystone of AJAX is the __________ object.
XMLHttpRequest
What can the XMLHttpRequest object do?
It can exchange data with the web server. Allows you to update parts of a website without reloading the whole page.
T or F: All modern browsers have a built-in XMLHttpRequest object.
True
What is theeh syntax for creating a XMLHttpRequest object?
variable nameSpace= new XMLHttpRequest();
Both ___ _____ and the ___ files XMLHttpRequest tries to load, must be located on the same server.
web page, XML
The ‘new XMLHttpRequest()’ method creates what?
Creates a new XMLHttpRequest object
The ‘about()’ method does what?
Cancels the current request
The ‘getAllResponseHeaders()’ does what?
Returns header information
The ‘open(method, url, async, user, psw)’ does what?
What values does the (method, url , async, user, psw) hold?
Specifies the request.
method: the request type GET or POST
url: the file location
async: true(asynchronous) or false (synchronous)
user: optional user name
psw: optional password
The ‘send()’ method does what?
Sends the request to the server.
Used for Get requests
The ‘send(string)’ method does what?
Sends the request to the server.
Used for POST request.
The ‘setRequestHeader()’ does what?
Adds a label/value pair to the header to be sent.
The property ‘onreadystatechange’ does what?
Defines a function to be called when the readyState property changes.
The property ‘readyState’ does what?
Holds the status of the XMLHttpRequest.
What does the numbers for the readState property mean? 0: 1: 2: 3: 4:
0: request no initialized
1: server connection established
2. request received
3. processing request
4. request finished and the response is ready.