Concepts Flashcards
0
Q
AJAX and its purposes
A
- Asynchronous Javcascript and XML
Purposes
- request information from a web server
- update content on a web page without loading a new web page
- post data to a web server
- able to use AJAX with any server-side language
1
Q
Asynchronous
A
- callbacks for multiple AJAX requests may not run in the order the requests were sent
- servers may take longer to respond to certain requests, so callbacks run in the order in which the responses return
2
Q
GET
A
- requests a new web page, CSS file, or image
- “get” information from a web server
- send data in the URL
3
Q
Programming Process
A
- Create an XMLHTTP Request object
- Create a callback function
- Open a request
- Send the request
- var xhr = new XHMLHttpRequest();
- xhr.onreadystatechange = function() {};
- xhr.open(‘GET’, ‘data/employees.json’);
- xhr.send();
4
Q
Query String
A
- information sent to the web server
- it is added to the end of a URL
5
Q
POST
A
- used with web forms to send data in a database
- sending data to store, delete, or update information from a database
- send more than 2083 characters of data to the web server
- sends data in the “body” of the request
6
Q
Security Limitations
A
- same-origin policy
Circumventions
- create a web proxy
- JSON with Padding (JSON)
- Cross-Origin Resource Sharing (CORS)
7
Q
Web Proxy
A
- it allows you to bypass a web brower’s same origin policy by retrieving data from another server, while keeping AJAX requests within the same domain