How does the XMLHttpReqeust
variable impact the functionality of the following code snippets?
function getHTTPObject() {
if (typeof XMLHttpRequest == "undefined") {
XMLHttpRequest = function () {
try {
return new ActiveXObject('Msxml2.XMLHTTP.6.0');
} catch (e) {
}
try {
return new ActiveXObject('Msxml2.XMLHTTP.3.0');
} catch (e) {
}
try {
return new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
}
return false;
}
}
return new XMLHttpRequest();
}
I conducted an experiment by removing the XMLHttpRequest
variable and found that the code continued to work as expected. Does it simply create an anonymous function in this case?