xmlHttpRequest vs Microsoft.XMLHTTP Active X

243 views
Skip to first unread message

Stern

unread,
Mar 10, 2009, 2:59:44 PM3/10/09
to Fork JavaScript
This article (and the comments) suggest that -- for IE7 -- it's better
to use Microsoft.XMLHTTP over XMLhttpRequest:

http://www.techtoolblog.com/archives/ie-7-native-xmlhttprequest-not-so-good

Now ForkJavascript includes these lines:

FORK.Ajax.newXMLHttpRequest = function() {
// Possible factories in reverse order of preference
// for use with efficient, reverse for-loop below.
var fs = [
function() { return new ActiveXObject("Microsoft.XMLHTTP"); },
function() { return new ActiveXObject("Msxml2.XMLHTTP"); },
function() { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); },
function() { return new XMLHttpRequest(); }
];

Do you think it's wiser to reverse the order like so?

function() { return new ActiveXObject("Msxml2.XMLHTTP"); },
function() { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); },
function() { return new XMLHttpRequest(); }
function() { return new ActiveXObject("Microsoft.XMLHTTP"); },

Peter Michaux

unread,
Mar 10, 2009, 3:52:54 PM3/10/09
to forkjav...@googlegroups.com

Personally, I have not had any reported problems using XMLHttpRequest
with IE7 with tens of thousands users. There doesn't seem to be a
particular test case mentioned that can reproduce the problem on
demand. That said, I don't see a real problem checking for the ActiveX
object first. I will keep this in mind for the next version of Fork.
Thanks for posting about this.

Peter

Stern

unread,
Mar 10, 2009, 4:00:21 PM3/10/09
to Fork JavaScript

Check out this older thread
http://groups.google.com/group/forkjavascript/browse_thread/thread/33778e2c6241a550

Also, by sheer coincidence, I was playing with Yahoo's new mail today,
which is full of fancy Ajax scripting, and for no reason, IE7 froze on
me. I had to close the browser and restart. I don't know if that's at
all related to this issue, or something unique to Yahoo.

I agree it's rare and random and almost impossible to troubleshoot and
seems like a hard-to-believe conspiracy theory, but I know it's
there :)

Stern

unread,
Mar 10, 2009, 4:43:55 PM3/10/09
to Fork JavaScript
On a related note:
http://bytes.com/groups/javascript/559991-msxml-xmlhttp-vs-microsoft-xmlhttp

And here:
http://www.quirksmode.org/book/printable/xmlhttp.txt
140. var XMLHttpFactories = [
141. function () {return new XMLHttpRequest()},
142. function () {return new ActiveXObject("Msxml2.XMLHTTP")},
143. function () {return new ActiveXObject("Msxml3.XMLHTTP")},
144. function () {return new ActiveXObject
("Microsoft.XMLHTTP")},
145. ];

Is the above also in ascending order of preference? Because the
Quirksmode guy is like a scripting guru, isn't he?

P.S. Difference between Msxml2.XMLHTTP.3.0 or Msxml3.XMLHTTP ??

I am a newbie to the nitty gritty of Javascript, so I'm just throwing
a bunch of miscellanious stuff at you, hoping that something makes
sense.

Peter Michaux

unread,
Mar 11, 2009, 3:12:30 AM3/11/09
to forkjav...@googlegroups.com
On Tue, Mar 10, 2009 at 9:43 PM, Stern <ster...@hotmail.com> wrote:
>
> On a related note:
> http://bytes.com/groups/javascript/559991-msxml-xmlhttp-vs-microsoft-xmlhttp
>
> And here:
> http://www.quirksmode.org/book/printable/xmlhttp.txt
> 140.    var XMLHttpFactories = [
> 141.        function () {return new XMLHttpRequest()},
> 142.        function () {return new ActiveXObject("Msxml2.XMLHTTP")},
> 143.        function () {return new ActiveXObject("Msxml3.XMLHTTP")},
> 144.        function () {return new ActiveXObject
> ("Microsoft.XMLHTTP")},
> 145.    ];
>
> Is the above also in ascending order of preference?

I looked very briefly, on line 149 you can see he tries them in order
starting from index zero. So that means he would be using
XMLHttpRequest in IE7.

> Because the
> Quirksmode guy is like a scripting guru, isn't he?

That wouldn't mean he knows everything.

> P.S. Difference between Msxml2.XMLHTTP.3.0 or Msxml3.XMLHTTP ??

I looked into this stuff and cannot remember off the top of my head. I
did ask about the differences on comp.lang.javascript

http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/2b35831ff4a50315?tvc=1&q=petermichaux+martin+xmlhttprequest

and will be reviewing that thread in the future. Martin Honnen replied
and he doesn't seem to reply unless he is correct.

Peter

Jason S

unread,
Apr 28, 2009, 12:56:56 PM4/28/09
to Fork JavaScript
> > Because the
> > Quirksmode guy is like a scripting guru, isn't he?
>
> That wouldn't mean he knows everything.

Peter-Paul Koch (aka PPK = the guy behind quirksmode.org) does try to
stay current on cross-browser issues. He doesn't know everything, but
it's probably worth letting him know if the method you find best for
creating XML HTTP request objects differs from his. (granted, if you
posted on c.l.j he ought to be checking that newsgroup at least once
in a while... I found it too noisy and nasty to be worth my while :
( oh well.)
Reply all
Reply to author
Forward
0 new messages