My ajax app works fine in Firefox, but not in IE8. Specifically, the ajax functionality doesn't work.
Here's the code I'm using:
function createXMLHttpRequest()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
This is the error:
Object doesn't support this property or method
ajax.js
Code:0
Line : 6
Char : 5
It works perfect in Firefox.
What is the problem with my code ?
straight out of jQuery:
return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") :
new XMLHttpRequest();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With