Closed Bug 343769 Opened 18 years ago Closed 8 years ago

XMLHttpRequest onreadystatechange not firing after readyState = 1

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: trollll, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060701 Minefield/3.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060701 Minefield/3.0a1

If you have an onreadystatechange listener set in JavaScript, it fires when readyState = 1 but not for any other readyState. This basically stops all "Ajax" (read: XMLHttpRequest) responses from getting parsed and used, since 99% of scripts wait until the response fully returns before attempting to use it.

Reproducible: Always

Steps to Reproduce:
1. Go to http://www.joehewitt.com/
2. Below a post of his that has comments, click the "Comments" link

OR

1. Go to http://www.infoq.com/
2. Click one of the tabs on the right-hand column
Actual Results:  
Perpetual loading messages, since readyState never reaches 4.

Expected Results:  
onreadystatechange fires until it returns 4 (or something bad happens) and content loads.

If you watch the traffic on port 80 or have Firebug installed, you'll see that the XMLHttpRequest response loads perfectly fine. For some reason the XMLHttpRequest response object just never triggers onreadystatechange where readyState = 4.

Also, I've only noticed this in the Firefox nightly builds (aka Minefield), but for some reason I can no longer find the option to specify a version...
not js engine.
Assignee: general → general
Component: JavaScript Engine → DOM
QA Contact: general → ian
(Apologies for categorizing incorrectly - bugs me when people do that on my projects)

I can confirm that this also happens for MacOS 10.3 and MacOS 10.4 (same browser versions), though once again I can't find the starting point as far as a build date that doesn't have this bug.
I ran into something similar...

xmlHTTPRequests don't seem to work in Minefield if firebug is enabled.

Disabling firebug (using the menu in the lower left, not using the add-ons manager) fixes this.

This is with:

Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9a1) Gecko/20060714 Minefield/3.0a1
(In reply to comment #3)
> I ran into something similar...
> 
> xmlHTTPRequests don't seem to work in Minefield if firebug is enabled.
> 
> Disabling firebug (using the menu in the lower left, not using the add-ons
> manager) fixes this.
> 
> This is with:
> 
> Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9a1) Gecko/20060714
> Minefield/3.0a1
> 

Yeah, confirmed. So at this point somebody with the know-how needs to see if it stems from the extension or from how it handles the extension?
Hi,
I am seeing bad behavior with or without Firebug. I put an alert in the onreadychangestate function and it never gets past 1.
Assignee: general → nobody
QA Contact: ian → general
I believe this bug is still present in Firefox 4 beta, and it breaks, among other things, jQuery and mootools. In fact, I never see onreadystatechange getting called. I would call this a definite critical/blocker bug.

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1

Testcase URL:

http://jsfiddle.net/sGQ5s/
haha disregard that. Firebug alpha is the culprit of my problem; showing XmlHttpRequests in the console causes them to stop working. Note to self: safe mode test first, THEN post bugzilla.
Regarding comments 6 and 7, you are probably seeing bug 557791
I can't replicate this now, and given the time that has passed and the lack of comments here over the years, I don't see a reason to keep this bug open.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.