diff options
author | John Resig <jeresig@gmail.com> | 2010-01-24 22:13:52 -0500 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-01-24 22:13:52 -0500 |
commit | 76236a15062aa82a4841748e9071eb3c9535ef62 (patch) | |
tree | db49a34ccc2bc0dd631da59ee71fb2d41a87187c | |
parent | c639405c4d1ec462b032ccfb571a6c73212ba101 (diff) | |
download | jquery-76236a15062aa82a4841748e9071eb3c9535ef62.tar.gz jquery-76236a15062aa82a4841748e9071eb3c9535ef62.zip |
Use alternative technique for triggering an abort, preventing an exception from being thrown in Firefox. Fixes #5923.
-rw-r--r-- | src/ajax.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ajax.js b/src/ajax.js index d92d26d15..754de09a3 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -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) { } |