It is not a new language to learn. If you know java script and html, it is enough. Before using that, we must create object for it. It differs for browsers, mainly for Firefox and Internet Explorer.
// code for IE7+, Firefox, Chrome, Opera, Safari
else if (window.ActiveXObject)
// code for IE6, IE5
Now we need to create a callable function and also an onreadystatechange handler.
/* Each state has different description:
0 The request is not initialized
1 The request has been set up
2 The request has been sent
3 The request is in process
4 The request is complete
The xmlhttp.open method call opens a connection to the mentioned page, the first parameter is POST or GET depending on the method you want to use. There is only one difference between get and post method. If you use get method, the data you are passing will be displayed in your browser address bar. But it wont be displayed if you are using post method. The second parameter is the filename of the page relative to the current directory. In the next line, whenever it goes through a statechange to call a certian function, the handler. xmlhttp.send passes variables to the script that we are calling.
The handler function gets called every time that xmlhttp changes state. We have the if statement so that it will only execute when readyState==4 (4 is completed). The last statement of course retrieves the data from the xmlhttp object. If you are getting most types of data you should use the responseText property, for actual XML data use the responseXML property. The next statement just closes the socket connection establishment.