Skip to main content

Bug Tracker

Side navigation

#3939 closed bug (fixed)

Opened January 21, 2009 01:50PM UTC

Closed June 11, 2010 03:01AM UTC

Last modified March 14, 2012 11:44AM UTC

IE7 Line 3427 (jQuery 1.3 rev6104) xhr.readyState is null or not an object

Reported by: jfk Owned by:
Priority: major Milestone: 1.3
Component: ajax Version: 1.3
Keywords: XMLHttpRequest AJAX Cc:
Blocked by: Blocking:
Description

Shows only in IE7. I think this bug shows because one crucial check is absent.

Offending line (3427):

if (xhr.readyState == 0) {

Fixed line:

if (xhr && xhr.readyState == 0) {

The bug manifests when timeout is set in $.ajax options. Regretably, I don't have sufficient time to make solid test case.

Attachments (1)
Change History (9)

Changed January 22, 2009 03:25AM UTC by dmethvin comment:1

Reviewing the code, it does seem like there could be situations where this could happen. When the request completes for any reason on an async request, xhr is set to null. However, the if (xhr.readyState == 0) leg does not set requestDone to true. If the timeout checker fires after that, it would go through onreadystatechange with a null xhr object.

A test case would help, but if you can't make one could you say a bit more about when this happens? Is it solidly reproducible or kind of sporadic?

Changed January 22, 2009 03:25PM UTC by jfk comment:2

OK, I've found some time for test case, see attachement. I tested on FF3, IE6/XP, IE7/Vista, IE8/Vista, Opera, Chrome, Safari (latest stable versions). The only one which spits error is IE7/Vista.

Changed January 30, 2009 02:47AM UTC by dmethvin comment:3

Thanks for creating the test. Definitely looks like a timeout situation.

Changed January 30, 2009 10:06AM UTC by jfk comment:4

I've tested this bug on jQuery 1.3.1 and it is still present.

Changed March 26, 2009 03:11PM UTC by mauricei comment:5

I've been getting the same error in my application since update to 1.3 and up to 1.3.2. For me it occurs in all version of IE (IE6/XP, IE7/XP, IE8/Vista).

I tried adding a check to see if xhr was defined as suggested and it does fix the javascript error. The problem is that the ival variable is also null so without any javascript error the interval keeps executing indefinitely (>1000 method calls in a couple of seconds).

I will keep on trying to make a simple test case but have not yet found a way to reproduce it outside my application.

Changed March 31, 2009 05:15PM UTC by pawprint_net comment:6

I am having this same problem - again would be very difficult to create a standalone test case. but will provide any information that I can if requested.

Changed May 31, 2009 01:46AM UTC by dev comment:7

I'm getting same error on IE6 and jQuery 1.3.2

On removing timeout property, the jQuery kept trying request for 55 seconds (on a simulated server delay).

Changed September 03, 2009 12:15AM UTC by damonmiller513 comment:8

I am getting this same issue. I'm using IE8/Vista and jQuery 1.3.2. The issue only occurs when setting a timeout for the XHR call and if the request actually does timeout.

I came to the same conclusion that modifying the error line to 'if (xhr && xhr.readyState == 0) {' stops the issue. However, I do not know if this would have other issues doing this.

Changed June 11, 2010 03:01AM UTC by dmethvin comment:9

resolution: → fixed
status: newclosed

This bug was fixed in 1.4.