Bug Tracker

Modify

Ticket #6471 (closed bug: duplicate)

Opened 3 years ago

Last modified 14 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by addyosmani

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to duplicate

comment:2 Changed 3 years ago by addyosmani

Duplicate of #6256.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.