Re: calling abort method on XMLHttpRequest instance fires onreadystatechange with readyState 4
Lucky <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Message-ID | <[email protected]> |
Martin Honnen wrote: > Lucky wrote: > >> I think in this case, mozilla is doing the same thing as microsoft, >> but so much that it is actually mirroring a bug that msxml has, for it >> does go to 4 after abort(), and then to 0, only the documentation >> states differently. > > Does the test case I posted > <http://home.arcor.de/martin.honnen/mozillaBugs/XMLHttpRequest/abortChangesReadyState4.html> > > show any change to readyState 4 then 0 when calling abort with > readyState 1, 2, or 3? What IE version is that then? > IE 6 here simply aborts and goes to readyState 0. > > No, but that testcase is a bit off, for if you call as you get to a 1 readyState, that could be the intial 1 that really hasn't done anything.. eg: the 1, 1, 2, 3, 4 states order, when onreadystatechange is set before the open/send calls. the better test is to call the abort after a quick timeout. i have experienced the jump to 4 after doing my own abort code for a timeout, if server is busy. setting a setTimeout(..., 10000) to then call the abort(); and then it went to a readyState 4 in msxml.. you could simply move the timeout down to a sec, or less, and call upon a website that may have a slight latency to achieve another scenario of abort() being called. will cook up a testcase to show tomorrow if time allows, a bit under weather right now.