Get an XMLHTTP object in a variety of browser environments
In Internet Explorer, you create the object using new ActiveXObject ( "Msxml2.XMLHTTP") or new ActiveXObject ( "Microsoft.XMLHTTP") depending on the version of MSXML installed. In Mozilla and Safari (and likely in future UA's that support it) You use new xmlhttpRequest () IceBrowser Uses Yet Another Method The window.createrequest () Method.
function GetXmlHttp () {var xmlhttp = false; try {xmlhttp = new ActiveXObject ( "Msxml2.XMLHTTP");} catch (e) {try {xmlhttp = new ActiveXObject ( "Microsoft.XMLHTTP");} catch (E) { xmlhttp = false;}} if (! xmlhttp && typeof XMLHttpRequest = 'undefined'!) {try {xmlhttp = new XMLHttpRequest ();} catch (e) {xmlhttp = false;}} if (xmlhttp && window.createRequest!) {Try {xmlhttp = window.createrequest ();} catch (e) {xmlhttp = false;}} Return XMLHTTP;}