window.XMLHtt prequest未定义在IE7 / IE8 [英] window.XMLHttpRequest is undefined in IE7/IE8
本文介绍了window.XMLHtt prequest未定义在IE7 / IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
的window.XMLHtt prequest值是不确定的,当我跑我的,即使在IE7或IE8的应用程序,有什么我必须启用IE7,使其工作。
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.
感谢
推荐答案
您可以做这样的事情:
if (!window.XMLHttpRequest) {
window.XMLHttpRequest = function() {
return new ActiveXObject('Microsoft.XMLHTTP');
};
}
我建议看一个AJAX库虽然生活在jQuery的,ExtJS的,MooTools的,很容易不管你preFER。
I recommend looking at an AJAX library though, life is much easier in jQuery, ExtJS, MooTools, whatever you prefer.
这篇关于window.XMLHtt prequest未定义在IE7 / IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文