I am trying to write my own Xhr wrapper as practice. I am in the process of getting things to work cross browser I came across this piece of code that initiates a xhr object for all browsers IE5.5+
But i personally dont really understand how to now use this instantiated xhr object.
See the code below:
(function () {
try {
return new(this.XMLHttpRequest || ActiveXObject)('MSXML2.XMLHTTP.3.0');
} catch (e) {}
})();
Could someone explain to me how to use the instantiated xhr object?
And maybe for my own learning experience how this (function (){})(); thing works
If something is unclear let me know so I can clarify!