AJAX Flashcards

1
Q

AJAX stands for?

A

Asynchronous JavaScript and XML

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

What does AJAX do to improve the interactive experience in web apps?

A

• AJAX eliminates the need to reload a web page in
order to get new content from the server

• Removes the start-stop interaction where a
user has to wait for new pages to load.

• An intermediate layer (AJAX Engine) is introduced
into the communication chain between client and
server

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

List how AJAX works (7 steps)

A
  1. An event occurs in a web page (the page is loaded,
    a button is clicked)
  2. An XMLHttpRequest object is created by JavaScript
  3. The XMLHttpRequest object sends a request to a
    web server
  4. The server processes the request
  5. The server sends a response back to the web page
  6. The response is read by JavaScript
  7. Proper action (like page update) is performed by
    JavaScript
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a callback function?

A

A callback function is a function passed as a parameter to another function

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

What is the the keystone of AJAX

A

XmlHttpRequest Object

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

What is the XmlHttpRequest Object?

A

• The XHR is an object that is part of the DOM and
is built into most modern browsers
• It can communicate with the server by sending
HTTP requests (much like normal client/server
communication)

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

What is so good about the XmlHttpRequest Object?

A

• Independent of or <a> elements for
generating HTTP GET/POST requests
• It does not block script execution after sending
an HTTP request • As with content and style, JavaScript can now
programmatically manage HTTP communication</a>

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

what are the XmlHttpRequest Properties?

A

• readyState property

• onreadystatechange property
• status property
• responseXML property
responseText property

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

what are the XmlHttpRequest Methods?

A

• abort() – Cancels the current request • open(method, url, async, user, psw) – 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
• send() – Sends the request to the server – Used for GET requests
• send(string) – Sends the request to the server. – Used for POST requests
• getAllResponseHeaders() – Returns all header information of a resource such
as length, server-type, content-type, last-modified
• getResponseHeader() – Returns specific header information such as “LastModified”
• setRequestHeader() – Adds a label/value pair to the header to be sent – Can be used with POST data to specify the data
you want to send with the send() method

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