git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c639405
)
Use alternative technique for triggering an abort, preventing an exception from being...
author
John Resig
<jeresig@gmail.com>
Mon, 25 Jan 2010 03:13:52 +0000
(22:13 -0500)
committer
John Resig
<jeresig@gmail.com>
Mon, 25 Jan 2010 03:13:52 +0000
(22:13 -0500)
src/ajax.js
patch
|
blob
|
history
diff --git
a/src/ajax.js
b/src/ajax.js
index
d92d26d
..
754de09
100644
(file)
--- 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
// 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 ) {
// 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 );
xhr.abort = function() {
if ( xhr ) {
oldAbort.call( xhr );
- if ( xhr ) {
- xhr.readyState = 0;
- }
}
}
- onreadystatechange();
+ onreadystatechange( "abort" );
};
} catch(e) { }
};
} catch(e) { }