@@ -10,9 +10,7 @@ jQuery.ajaxSettings.xhr = function() {
10
10
} catch ( e ) { }
11
11
} ;
12
12
13
- var xhrId = 0 ,
14
- xhrCallbacks = { } ,
15
- xhrSuccessStatus = {
13
+ var xhrSuccessStatus = {
16
14
// file protocol always yields status code 0, assume 200
17
15
0 : 200 ,
18
16
// Support: IE9
@@ -21,17 +19,6 @@ var xhrId = 0,
21
19
} ,
22
20
xhrSupported = jQuery . ajaxSettings . xhr ( ) ;
23
21
24
- // Support: IE9
25
- // Open requests must be manually aborted on unload (#5280)
26
- // See https://support.microsoft.com/kb/2856746 for more info
27
- if ( window . attachEvent ) {
28
- window . attachEvent ( "onunload" , function ( ) {
29
- for ( var key in xhrCallbacks ) {
30
- xhrCallbacks [ key ] ( ) ;
31
- }
32
- } ) ;
33
- }
34
-
35
22
support . cors = ! ! xhrSupported && ( "withCredentials" in xhrSupported ) ;
36
23
support . ajax = xhrSupported = ! ! xhrSupported ;
37
24
@@ -43,8 +30,7 @@ jQuery.ajaxTransport(function( options ) {
43
30
return {
44
31
send : function ( headers , complete ) {
45
32
var i ,
46
- xhr = options . xhr ( ) ,
47
- id = ++ xhrId ;
33
+ xhr = options . xhr ( ) ;
48
34
49
35
xhr . open (
50
36
options . type ,
@@ -84,7 +70,6 @@ jQuery.ajaxTransport(function( options ) {
84
70
callback = function ( type ) {
85
71
return function ( ) {
86
72
if ( callback ) {
87
- delete xhrCallbacks [ id ] ;
88
73
callback = xhr . onload = xhr . onerror = null ;
89
74
90
75
if ( type === "abort" ) {
@@ -117,7 +102,7 @@ jQuery.ajaxTransport(function( options ) {
117
102
xhr . onerror = callback ( "error" ) ;
118
103
119
104
// Create the abort callback
120
- callback = xhrCallbacks [ id ] = callback ( "abort" ) ;
105
+ callback = callback ( "abort" ) ;
121
106
122
107
try {
123
108
// Do send the request (this may raise an exception)
0 commit comments