Ajax调用:什么是新的ActiveXObject之间的差异(QUOT; MSXML2.XMLHTTP")和新的ActiveXObject(" Microsoft.XMLHTTP")? [英] Ajax call: What is the difference between new ActiveXObject("Msxml2.XMLHTTP") and new ActiveXObject("Microsoft.XMLHTTP")?

查看:199
本文介绍了Ajax调用:什么是新的ActiveXObject之间的差异(QUOT; MSXML2.XMLHTTP")和新的ActiveXObject(" Microsoft.XMLHTTP")?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这两个对象调用指的是ActiveXObject的。 但是,为什么我们传递了两个不同的参数,在IE工作。 1. MSXML2.XMLHTTP和 2. Microsoft.XMLHTTP

I hope both the object invocations are referring to the ActiveXObject. But why are we passing two different parameters to work in IE. 1. Msxml2.XMLHTTP and 2. Microsoft.XMLHTTP

是他们都一样吗?或者,他们依赖于浏览器(IE7和IE8)?

Are they both same ? Or Are they browser dependent(IE7 and IE8) ?

我同时使用。我没有得到任何的异常。两者都找我也一样。我使用IE 8。

I used both. I did not get any exception. Both are looking same for me. I am using IE 8.

推荐答案

这两个其实都是过时的。有各种版本的Microsoft的古老的MSXML ActiveX对象的(我相信上一次是5.0版,并附带一些版本的Office)的版本在行为的细微差别和bug修复,通常不会触及的AJAX方案发挥

Both are actually outdated. There are various versions of Microsoft's venerable MSXML ActiveX object (I believe the last one was version 5.0 and came with some version of Office.) The versions have minor differences in behavior, and bug fixes that usually don't come into play in AJAX scenarios.

与IE7开始,微软支持的标准化XmlHtt prequest对象等现代浏览器已经通过了。请参见 http://msdn.microsoft.com/en-美国/库/ ms537505(VS.85)的.aspx 。你绝对应该使用和IE7一样,现在的事实上的最小公分母。 IE6被宣告死亡,大多数主要组织,所以没有理由去支持旧Microsoft特定的ActiveX的ProgIDs。

Starting with IE7, Microsoft supported the standardized "XmlHttpRequest" object that other modern browsers had adopted. See http://msdn.microsoft.com/en-us/library/ms537505(VS.85).aspx. You should definitely be using that as IE7 is now the de-facto lowest common denominator. IE6 has been declared dead by most major organizations, so there's no reason to support the old Microsoft-specific ActiveX ProgIDs.

当然,有很少的原因,这些天来推出自己的AJAX调用,像jQuery和ASP.NET Ajax库为你做,抽象出这些不起眼的浏览器怪癖。我强烈建议学习的图书馆之一。

And of course, there is very little reason these days to roll your own AJAX calls, as libraries like jQuery and ASP.NET Ajax do it for you, abstracting away these obscure browser quirks. I would strongly suggest learning one of those libraries.

乔丹丽格

这篇关于Ajax调用:什么是新的ActiveXObject之间的差异(QUOT; MSXML2.XMLHTTP")和新的ActiveXObject(" Microsoft.XMLHTTP")?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆