Commit 76236a15 authored by John Resig's avatar John Resig

Use alternative technique for triggering an abort, preventing an exception...

Use alternative technique for triggering an abort, preventing an exception from being thrown in Firefox. Fixes #5923.
parent c639405c
......@@ -392,7 +392,7 @@ jQuery.extend({
// Wait for a response to come back
var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
// The request was aborted
if ( !xhr || xhr.readyState === 0 ) {
if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
// Opera doesn't call onreadystatechange before this point
// so we simulate the call
if ( !requestDone ) {
......@@ -458,12 +458,9 @@ jQuery.extend({
xhr.abort = function() {
if ( xhr ) {
oldAbort.call( xhr );
if ( xhr ) {
xhr.readyState = 0;
}
}
onreadystatechange();
onreadystatechange( "abort" );
};
} catch(e) { }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment