XML HTTP REQUEST

The XMLHTTPRequest object used to send and receive data from a web server using JAVASCRIPT.

Before there this XMLHttpRequest object, the only way to send and receive data from a web server was using 2 web pages. The first web page, using one page (form) that collected the data to send, and clicking "Submit" (or any text), send data to the second site, the processed and the results showed. Yet this is still used in most web pages and sites.

Now with the XMLHttpRequest object, it is possible to perform the above process in a single web page. From JAVASCRIPT, which is a programming language that runs on the client or web browser, using XMLHttpRequest, within a single web page can make requests to a web server, and collect the results without leaving this site only and without the user noticing.

The data sent by XMLHttpRequest, are in XML format, and we use the XML format for receiving data from the web site, it is called XMLHttpRequest.

XMLHttpRequest syntax:

For modern web browsers (Firefox, Chrome, Internet Explorer IE7+, Safari y Opera):

xmlhttp = new XMLHttpRequest();

For older browsers from Internet Explorer IE6, IE5

xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

Examples of use of XMLHttpRequest:

The most typical are the suggestions we offer some web pages when you are entering data.

These tips are thanks to the XMLHttpRequest object.

The website is constantly sending all that we write to a web server via XMLHttpRequest, the web server processes them and returns the results, that this same website used to offer suggestions on what we write.