logo       

Re: calling abort method on XMLHttpRequest instance fires onreadystatechang: msg#00002

Subject: Re: calling abort method on XMLHttpRequest instance fires onreadystatechange with readyState 4
Martijn wrote:
I think you're right.
The xmlhttprequest is a Microsoft thing, so Mozilla should do exactly
like Microsoft in this case (also because it makes sense).

It seems to me that the lxr url you gave is indeed the place in the
code where Mozilla is going wrong.
Looking at bonsai:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp&rev=1.147#684

That code was added with bug 258768.
When reading https://bugzilla.mozilla.org/show_bug.cgi?id=258768#c4 it
seems that was a foreseen side-effect of the patch.

Probably you should file a bug on it, I think.

Regards,
Martijn

On 4/1/06, Martin Honnen <mahotrash@xxxxxxxx> wrote:
Martin Honnen wrote:


Other implementations (Opera 8.5, IE 6 with Microsoft.XMLHTTP) simply
abort and set readyState to 0, not firing any onreadystatechange
handler, certainly not one with readyState 4.
The documentation of MSXML's IXMLHttpRequest abort method
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/7b1cfc92-5078-404a-85a2-a907fe1184a2.asp>
also says:
   "The request will be returned to the UNINITIALIZED state"
and
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/0e6a34e4-f90c-489d-acff-cb44242fafc6.asp>
defines UNINITIALIZED as 0.

Why does Mozilla do a 4 to 0 transition with readyState, why does it not
directly go to readyState 0?

--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@xxxxxxxxxxxxxxxxx
https://lists.mozilla.org/listinfo/dev-tech-xml

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.

common coding practices is to remove the onreadystatechange by setting it to an empty function after abort, for using MSXML you cannot simply null out the onreadystatechange

http.onreadystatechange = function() {}
http.abort()


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe