views:

1322

answers:

3

Am I correct to understand that the abort() method for XMLHttpRequest objects is only available starting from MSIE 7? If so, what equivalent option do I have for aborting an XMLHttpRequest object on timeout in MSIE 6?

Using a JS framework to abstract the problem away is not an option at this time I'm afraid :(. I'm on a legacy system that's close to a production deadline.

A: 

I'd look to a framework like jQuery for doing http requests with javascript. They nicely abstract away browser differences.

benlumley
A framework is not an option at this time I'm afraid :(. I'm on a legacy system that's close to a production deadline.
urig
+3  A: 

On IE6, you instantiate the MSXML HTTPRequest manually, so it all comes down to what version you end up using.

abort is implemented in MSXML 3.0 and later. In other words, if you can get this or a later version instantiated (rather than 2.0 or 2.6), you can use abort.

To the best of my knowledge, IE6 should use MSXML 3.0 when nothing else is specified (http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx seems to confirm this), so it should work out of the box - but I can't test this right now, as I don't have access to an IE6 machine.

Michael Madsen
A: 

Bearing in mind that IE does not support XMLHttpRequest really, but Microsoft.XMLHTTP and various related flavours, the answer is abort is available depending on the instantiated object I believe.

This article and this article might help you with the problem your having.

annakata