From c580a529716cd89eccdbda1bf3e9636e5a38811e Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Fri, 10 Oct 2014 21:01:59 +0400 Subject: [PATCH] Ajax: remove event dependency from the ajax module Ref 4e7f34f6296111f7f91d621397dfb02c6bf4c41f --- src/ajax/xhr.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 31999d44e..149c49e5d 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 ); } -- 2.39.5