Value of window.XMLHttpRequest is Undefined when i run my application even in IE7 or IE8, Is there anything i have to enable in IE7 to make it work.
Thanks
I enabled the native XMLHTTP support from internet options, after this the my code started working fine.
You can do something like this:
if (!window.XMLHttpRequest) {
window.XMLHttpRequest = function() {
return new ActiveXObject('Microsoft.XMLHTTP');
};
}
I recommend looking at an AJAX library though, life is much easier in jQuery, ExtJS, MooTools, whatever you prefer.
https://gist.github.com/jed/993585/#comment-40084
var xhr = (function(){
try{
return new(this.XMLHttpRequest||ActiveXObject)('MSXML2.XMLHTTP.3.0');
} catch(e) {};
}());