Skip to main content

Bug Tracker

Side navigation

#4436 closed bug (fixed)

Opened March 27, 2009 11:11AM UTC

Closed June 12, 2010 02:09PM UTC

Last modified May 21, 2013 10:43AM UTC

[ajax] j.readyState is null or not an object on IE6 with Timeout enabled

Reported by: ThomasCr Owned by:
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

I get the follow error message when I make a ajax reqest as shown on IE 6. Timeout doesnt working.. I get triggerd asap the error callback with textStatus = timeout

j.readyState is null or not an object on IE6 with Timeout enabled

    $.ajax({
            url: base_url + 'index.php',
            data: params,
            type: 'POST',
            dataType: 'xml', 
            cache: false,
            timeout: 1000,
            success: this.action_success(this),
            error: this.action_error(this),
            complete: this.action_complete(this)
          })

I tested 1.3.1 and also the current 1.3.2

Attachments (0)
Change History (9)

Changed March 27, 2009 11:28AM UTC by ThomasCr comment:1

oh.. I forgot to say, that when I remove the timeout option from the reqest, that it works, without a error.

Changed April 30, 2009 08:09PM UTC by jmj comment:2

This error also happens in IE 7 for example:

$(document).ready(function() {
	$.ajax({
		url:"endless_loop.php",
		dataType:"json",
		timeout:2000,
		success: ExibeJSON,
		error: ExibeErro			
	});
});

function ExibeErro(XMLHttpRequest,textStatus,errorThrown) {
	alert(textStatus);
}

function ExibeJSON(jn) {
	alert(jn.lista);
}

Changed May 15, 2009 05:51PM UTC by snobo comment:3

I get it too, using IE7. It happens on the line "if (xhr.readyState == 0)" in the following fragment of 1.3.2 (line 3555):

// Wait for a response to come back
var onreadystatechange = function(isTimeout){
	// The request was aborted, clear the interval and decrement jQuery.active
	if (xhr.readyState == 0) {
		if (ival) {
			// clear poll interval
			clearInterval(ival);
			ival = null;
			// Handle the global AJAX counter
			if ( s.global && ! --jQuery.active )
				jQuery.event.trigger( "ajaxStop" );
		}

In FF3, no error.

Changed May 17, 2009 09:30AM UTC by rsilva4 comment:4

I get it too, using IE7. Can't say really where it is happening, a bunch of messy code in the page

Changed June 26, 2009 09:06AM UTC by psu comment:5

I get it too with IE. Fixed by changing first if(J.readyState... check to if(J&&J.readyState... so it checks if object exists in first place.

Changed August 20, 2009 08:04PM UTC by nomoon comment:6

I can confirm that this bug happens to me every time an ajax timeout event fires in IE 8. Very annoying.

Changed September 11, 2009 03:47AM UTC by arsa comment:7

Also getting this issue - just enabled system-wide reporting of JS errors back to server, and this is the error i am getting. Should it not come into error handler?

Changed June 12, 2010 02:09PM UTC by dmethvin comment:8

component: unfiledajax
resolution: → fixed
status: newclosed

This was fixed in 1.4. If you're having a problem with $.ajax in 1.4, please look for another ticket to open, ask for help on the forums, or create a new ticket with a clear test case.

Changed May 21, 2013 10:43AM UTC by emamirazavi@gmail.com comment:9

i use jsonp, PHP Zend Framework, send 301 response code, and redirection header. firebug shows location header correctly, jQuery fire up ajaxError but readyState in not correct! my browser is FF v.20, my jquery version is 1.9.1. any ideas?