AJAX Flashcards
What is a client?
A computer/server that sends request for information
What is a server?
A piece of software provides data or behavior in response to requests
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
What three things are on the start-line of an HTTP request message?
- HTTP method
- Request target/destination (usually url)
- HTTP version
Ex, GET/ _HTTP/ 1.1
What three things are on the start-line of an HTTP response message?
- Protocol version (usually HTTP/1,1)
- A status code (indicating success or failure of the request)
- A status text
Example: HTTP/1.1 404 Not Found. or HTTP/1.1 200 OK
What are HTTP headers?
Additional data about a request or response that is currently being sent
Where would you go if you wanted to learn more about a specific HTTP Header?
MDN
Is a body required for a valid HTTP request or response message?
No
What is AJAX?
It’s a technique for loading data into part of a page without having to refresh the entire page.
What does the AJAX acronym stand for?
Asynchronus JavaScript And XML
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
‘load’
Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
They share a prototype