Modify ↓
Ticket #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: | |
| 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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
