My Ajax model in Javascript is 100% valid, with a few inputs such as the method (Get or Post), page to communicate with, string to send, and element on my own page to manipulate upon response. The issue arises when I set the request to Asynchronous; IE throws an error "The Data Necessary to Complete This Operation is Not Yet Available" during the onreadystatechange event, even though I am simply checking for readyState 4 and status 200. This error does not occur in Firefox or Chrome, which are expected behaviors for asynchronous Ajax.
Here's a snippet from the Post method:
xmlhttp.open("POST", commPage, true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
j = xmlhttp.responseText;
i.innerHTML = j;
}
}
xmlhttp.send(str);
Edit: It should be noted that in IE, I'm using ActiveX Control -> Msxml2.XMLHTTP or Microsoft.XMLHTTP, whichever returns true first.