File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -463,10 +463,11 @@ jQuery.extend({
463
463
try {
464
464
var oldAbort = xhr . abort ;
465
465
xhr . abort = function ( ) {
466
- // xhr.abort in IE7 is not a native JS function
467
- // and does not have a call property
468
- if ( xhr && oldAbort . call ) {
469
- oldAbort . call ( xhr ) ;
466
+ if ( xhr ) {
467
+ // oldAbort has no call property in IE7 so
468
+ // just do it this way, which works in all
469
+ // browsers
470
+ Function . prototype . call . call ( oldAbort , xhr ) ;
470
471
}
471
472
472
473
onreadystatechange ( "abort" ) ;
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ test(".load()) - 404 error callbacks", function() {
137
137
} ) ;
138
138
139
139
test ( "jQuery.ajax() - abort" , function ( ) {
140
- expect ( 6 ) ;
140
+ expect ( 8 ) ;
141
141
stop ( ) ;
142
142
143
143
jQuery ( '#foo' ) . ajaxStart ( function ( ) {
@@ -157,7 +157,10 @@ test("jQuery.ajax() - abort", function() {
157
157
complete : function ( ) { ok ( true , "complete" ) ; }
158
158
} ) ;
159
159
160
+ equals ( xhr . readyState , 1 , "XHR readyState indicates successful dispatch" ) ;
161
+
160
162
xhr . abort ( ) ;
163
+ equals ( xhr . readyState , 0 , "XHR readyState indicates successful abortion" ) ;
161
164
} ) ;
162
165
163
166
test ( "Ajax events with context" , function ( ) {
You can’t perform that action at this time.
0 commit comments