]> source.dussan.org Git - jquery.git/commitdiff
Ajax: remove event dependency from the ajax module
authorOleg Gaidarenko <markelog@gmail.com>
Fri, 10 Oct 2014 17:01:59 +0000 (21:01 +0400)
committerMichał Gołębiowski <m.goleb@gmail.com>
Thu, 11 Dec 2014 22:58:09 +0000 (23:58 +0100)
(cherry-picked from c580a529716cd89eccdbda1bf3e9636e5a38811e)

Ref 4e7f34f6296111f7f91d621397dfb02c6bf4c41f

src/ajax/xhr.js

index 0f560f45a2b058067a18e74e99cb673ff22d0983..f458cebcc70727034d1674c49f7d55424d275f76 100644 (file)
@@ -32,8 +32,9 @@ var xhrId = 0,
 
 // Support: IE<10
 // Open requests must be manually aborted on unload (#5280)
-if ( window.ActiveXObject ) {
-       jQuery( window ).on( "unload", function() {
+// See https://support.microsoft.com/kb/2856746 for more info
+if ( window.attachEvent ) {
+       window.attachEvent( "onunload", function() {
                for ( var key in xhrCallbacks ) {
                        xhrCallbacks[ key ]( undefined, true );
                }