Bug Tracker

Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#6037 closed bug (duplicate)

oldAbort.call( xhr ) breaks in IE7 even within try/catch

Reported by: bpottle Owned by:
Priority: major Milestone: 1.4.2
Component: ajax Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:


Still hunting for the source of this bug in the existing code -- might be better off putting together a barebones proof. I'll see if I can get that together.

ajax.js (line 463):

try {
	var oldAbort = xhr.abort;
	xhr.abort = function() {
		if ( xhr ) {
			oldAbort.call( xhr ); // <-- *DIES HERE*
			onreadystatechange( "abort" );
} catch(e) { }

Basically, in IE7 only, this line throws the error "Object does not support this property or method." IE8 is unaffected. Interestingly, Firefox with the latest version of Firebug will constantly show "200 Aborted" as the status for 90% of my $.ajax() calls when using jQuery 1.4.1 (even though they complete successfully and return my data), but when I comment this line out, they immediately start giving "200 OK" instead.

Additional question: Why does this error get thrown at all when wrapped in a try/catch like it is?

Also worth noting that there was a previous ticket on this block of code that errored on an attempt to set readyState in IE. It appears that was changed in 1.4.1.

Change History (7)

comment:1 Changed 7 years ago by john

I haven't been able to reproduce this on my end - do you have any more information about what might be going on?

comment:2 Changed 7 years ago by bpottle

Sorry, something shiny ran by and I got distracted for a few days. I got partway through putting together a proof for this; I'll see if I can finish it and get it posted soon.

comment:3 Changed 7 years ago by bpottle

I was able to strip down my page to barebones elements and narrow down the cause of this error.

It appears it lies not with jQuery 1.4.1, but the jquery.ajaxmanager.js plugin. I'm going to continue to investigate, but this ticket can be closed.

comment:4 Changed 7 years ago by john

  • Resolution set to invalid
  • Status changed from new to closed

Thanks for clearing this up, I appreciate it!

comment:5 Changed 7 years ago by geki007

  • Resolution invalid deleted
  • Status changed from closed to reopened

I have the same error in IE7 (not chrome, not firefox, not IE8). I used jquery 1.4.2. See my testcase. I fixed the error with another try catch around the if block:

xhr.abort = function() {

try {

if ( xhr ) {

oldAbort.call( xhr );


} catch(e) { }


comment:6 Changed 7 years ago by Nick M

I've also encountered the same issue in IE7 (IE6 and IE8 don't seem to be affected).

However, the suggested fix of wrapping the if statement in another try block doesn't always seem to do the trick. If you have a callback on the request's completion that interacts with the response at all (eg, just checking "res.status" on the XMLHttpRequest object passed to complete()), IE7 will throw an "Unpsecified error" and completely ignore your abort call. I'll attach test case files that demonstrate this if you attempt to fix it with the extra try block.

It seems like everything works as expected in IE7 if you never attempt to override the abort method at all.

comment:7 Changed 6 years ago by snover

  • Resolution set to duplicate
  • Status changed from reopened to closed

Duplicate of #7018.

Note: See TracTickets for help on using tickets.