What is the purpose of ajax
technique that enables a page to request/submit data without reloading a page or postback
what is postback
when data is sent from browser to page (and typically new page is needed)
instantiate an XhtmlHttpRequest object
var xhr = new XhtmlHttpRequest();
using XHR, open a GET request to fetch google.com’s home page
xhr.open(“GET”, “http://www.google.com/”, false);
send an xhr request with null data
xhr.send(null);
Check if an xhr request returns a succesfull request
if (xhr.status == 200)
how can you find an xhr response’s plain text
xhr.responseText
how can you find an xhr status
xhr.statusText