Creating and sending XMLHttpRequest
For exchanging information between a webpage and a server, you use a XMLHttpRequest object. And as mentioned before, this will allow us to update different parts of a web page without having to reload the entire web page.
i.e. xmlHTTPRequest = new XMLHttpRequest();
Once you have your XMLHttpRequest object you can now exchange information with the server, to do this you will use two methods from the object:
o TypeOfRequest: set it to GET or POST
o serverURL: the location of the file retrieved
o CommunicationType: TRUE for Asynchronous or FALSE for Synchronous
o data: a String object with additional data needed for POST requests.