From f9d41ac641dcb5a93ba8a9027476b160d8f41111 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 28 Oct 2013 17:40:13 -0400 Subject: Fix #14379: AJAX requests on unload --- src/ajax/xhr.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/ajax') diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 8e6696b0d..5dbfc646f 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -18,18 +18,16 @@ var xhrSupported = jQuery.ajaxSettings.xhr(), // #1450: sometimes IE returns 1223 when it should be 204 1223: 204 }, - // Support: IE9 - // We need to keep track of outbound xhr and abort them manually - // because IE is not smart enough to do it all by itself xhrId = 0, xhrCallbacks = {}; +// Support: IE9 +// Open requests must be manually aborted on unload (#5280) if ( window.ActiveXObject ) { jQuery( window ).on( "unload", function() { for ( var key in xhrCallbacks ) { xhrCallbacks[ key ](); } - xhrCallbacks = undefined; }); } -- cgit v1.2.3