The XMLHttpRequest Flashcards

1
Q

The keystone of AJAX is the __________ object.

A

XMLHttpRequest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What can the XMLHttpRequest object do?

A

It can exchange data with the web server. Allows you to update parts of a website without reloading the whole page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

T or F: All modern browsers have a built-in XMLHttpRequest object.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is theeh syntax for creating a XMLHttpRequest object?

A

variable nameSpace= new XMLHttpRequest();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Both ___ _____ and the ___ files XMLHttpRequest tries to load, must be located on the same server.

A

web page, XML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The ‘new XMLHttpRequest()’ method creates what?

A

Creates a new XMLHttpRequest object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The ‘about()’ method does what?

A

Cancels the current request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The ‘getAllResponseHeaders()’ does what?

A

Returns header information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The ‘open(method, url, async, user, psw)’ does what?

What values does the (method, url , async, user, psw) hold?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The ‘send()’ method does what?

A

Sends the request to the server.

Used for Get requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The ‘send(string)’ method does what?

A

Sends the request to the server.

Used for POST request.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The ‘setRequestHeader()’ does what?

A

Adds a label/value pair to the header to be sent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The property ‘onreadystatechange’ does what?

A

Defines a function to be called when the readyState property changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The property ‘readyState’ does what?

A

Holds the status of the XMLHttpRequest.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
What does the numbers for the readState property mean?
0:
1:
2:
3:
4:
A

0: request no initialized
1: server connection established
2. request received
3. processing request
4. request finished and the response is ready.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the ‘responseText’ do?

A

Returns the response data as a string

17
Q

What does the ‘responseXML’ do?

A

Returns the response data as XML data.

18
Q

What does the ‘status’ property do?

A

Returns the status-number of a request

19
Q

What does the statusText property do?

A

Returns the status-text (eg. ‘OK’ or ‘Not Found’