window.XMLHttpRequest is undefined in IE7/IE8

前端 未结 3 1033
粉色の甜心
粉色の甜心 2020-12-18 11:21

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

3条回答
  •  独厮守ぢ
    2020-12-18 12:02

    https://gist.github.com/jed/993585/#comment-40084

    var xhr = (function(){
        try{
            return new(this.XMLHttpRequest||ActiveXObject)('MSXML2.XMLHTTP.3.0');
        } catch(e) {};
    }());
    

提交回复
热议问题