Hi zusammen,
ich habe ein für mich nicht nachvollziehbares AJAX-Problem beim IE.
Ich möchte einfach daten dynamisch nachladen. Im Firefox funktioniert alles wunderbar. Der IE bricht die Scriptverarbeitung ab, in dem Moment in dem ich auf "xmlHttp.responseText" zugreife.
Hat jemand dafür eine Lösung?
Danke
Thomas
Mein Quellcode:
var xmlHttp = null;
function handleResponse() {
if (xmlHttp.readyState == 4) {
alert(xmlHttp.getAllResponseHeaders()); // => hier kommt das script noch an
var tpm = xmlHttp.responseText;
alert(tpm); // => hier nicht mehr.
if(document.getElementById) document.getElementById("counter_online").innerHTML = xmlHttp.responseText;
else if(document.all) counter_online.innerHTML = xmlHttp.responseText;
}
}
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
// Internet Explorer 6 und lter
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xmlHttp = null;
}
}
}
function ReloadCounter() {
if (xmlHttp != null) {
xmlHttp.open('GET', 'counter_dhtml.php', true);
xmlHttp.onreadystatechange =handleResponse;
xmlHttp.send(null);
}
}