PDA

View Full Version : Ajax request fails in internet explorer



jamest
17 Jun 2011, 03:23 AM
Could someone help me figure out why this AJAX request is not completed in Internet Explorer. Thanks.


function openmanagegraphs() {
document.getElementById('managegraphs').style.display = 'block';
var xmlhttp;
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("results").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("POST", "PHP/mgon.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
CurrentRun;
xmlhttp.send("mgon=true");
}