I
Iain Adams
My code is as follows.
http_request = false;
if (window.XMLHttpRequest) {
alert("firefox");
http_request = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
alert("ie");
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.open('GET', url + parameters, true);
http_request.onreadystatechange = alertContents;
http_request.send(null);
}
Now I was under the impression that IE didnt have support for
XMLHttpRequest like firefox so thought you had to do it this way. But
this code works in firefox and alert says firefox. however code doesnt
work in IE and prints firefox in alert
http_request = false;
if (window.XMLHttpRequest) {
alert("firefox");
http_request = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
alert("ie");
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.open('GET', url + parameters, true);
http_request.onreadystatechange = alertContents;
http_request.send(null);
}
Now I was under the impression that IE didnt have support for
XMLHttpRequest like firefox so thought you had to do it this way. But
this code works in firefox and alert says firefox. however code doesnt
work in IE and prints firefox in alert