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: 3.0.0-alpha1~217 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4e7f34f6296111f7f91d621397dfb02c6bf4c41f;p=jquery.git Ajax: remove event dependency from the ajax module Closes gh-1695 --- diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index a733eded0..32afd2309 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -23,8 +23,9 @@ var xhrId = 0, // Support: IE9 // 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 ](); }