Hm...
Först av allt vet vi inte om det blir något XMLHttepRequest-objekt överhuvudtaget. Du borde ta och lägga till en else-sats före xmlHttpReq.open(...):
Kod:
else {
alert('Failed to create request object.');
return false;
}
Får du fortfarande samma resultat, testa att byta
Kod:
// Mozilla/Safari
if (window.XMLHttpRequest) {
xmlHttpReq = new XMLHttpRequest();
}
// IE
if (window.ActiveXObject) {
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
alert('Hej MSIE');
}
mot
Kod:
// Mozilla/Safari
try {
xmlHttpReq = new XMLHttpRequest();
} catch (e) {
// IE
try {
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
alert('Hej MSIE');
} catch (e) {
alert('Failed to create request object.');
return false;
}
}