I\'ve developed a web application that works well on chrome and firefox. However when it came to testing time and it doesn\'t work properly in IE. It just doesn\'t seem to a
From Wikipedia:
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) {}
//Microsoft.XMLHTTP points to Msxml2.XMLHTTP.3.0 and is redundant
throw new Error("This browser does not support XMLHttpRequest.");
};
As mentioned here, Internet Explorer supports the onload
event of the XMLHttpRequest object only since version 9.
So, for IE 8 and below, you can do it in the old fashioned way:
xhr.onreadystatechange = function()
{
//ready?
if (xhr.readyState != 4)
return false;
//get status:
var status = xhr.status;
//maybe not successful?
if (status != 200) {
alert("AJAX: server status " + status);
return false;
}
//Got result. All is good.
loading.innerHTML = '<a href="../classes/php/print.php" />Print Report</a>' +
'<br/><br/><a href="../index.php" />HomePage</a><br/>' +
'<a href="../classes/php/actionedClass.php" />Refresh</a><br/>' +
'<a href="../classes/php/logout.php" />Logout</a><br/>';
target.innerHTML = xhr.responseText;
return true;
}