Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#6471 closed bug (duplicate)

XHR request sometimes throw an error when it is aborted in IE8

Reported by: mefcorvi Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: ie8 ajax xhr abort Cc:
Blocked by: Blocking:

Description

In some cases "abort" method in IE8 (8.0.6001.18702IC) invokes onreadystatechange with readyState = 4.

I've fixed it in my code. I replaced

try {
  var oldAbort = xhr.abort;
  xhr.abort = function() {
    if ( xhr ) {
      oldAbort.call( xhr );
    }
    
    onreadystatechange( "abort" );
  };
} catch(e) { }

to

try {
  var oldAbort = xhr.abort;
  xhr.abort = function() {
    if ( xhr ) {
      xhr.onreadystatechange = jQuery.noop;
      oldAbort.call( xhr );
    }
    
    onreadystatechange( "abort" );
  };
} catch(e) { }

Change History (2)

comment:1 Changed 13 years ago by addyosmani

Priority: undecided
Resolution: duplicate
Status: newclosed

comment:2 Changed 13 years ago by addyosmani

Duplicate of #6256.

Note: See TracTickets for help on using tickets.