Creating an instance of the object used to make AJAX calls

Nowadays, AJAX is a ubiquitous technology in the IT world. When you need to create the object used to send asynchronous requests to a server, you might face the browser-difference problem. Here is a JavaScript function you could use to overcome this problem: // The following function creates an XMLHttpRequest object functioncreateHttpRequest(){if(typeofXMLHttpRequest!="undefined")//NOT IE { returnnewXMLHttpRequest();}elseif(window.ActiveXObject)// IE { varsVersions=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];//try to get an instance of the newer version. //If it is not available go down till the oldest one for(vari=0;i<sVersions.