From: Oleg Gaidarenko Date: Fri, 10 Oct 2014 17:01:59 +0000 (+0400) Subject: Ajax: remove event dependency from the ajax module X-Git-Tag: 1.11.2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1026d17d4c504e89b114d216500f513e43e41fdd;p=jquery.git Ajax: remove event dependency from the ajax module (cherry-picked from c580a529716cd89eccdbda1bf3e9636e5a38811e) Ref 4e7f34f6296111f7f91d621397dfb02c6bf4c41f --- diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 0f560f45a..f458cebcc 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -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 ); }