Ajax: Fix for request aborted in ajaxSend

Fixes gh-1775
Close gh-1619
This commit is contained in:
Dan Hart
2014-07-13 18:53:00 +01:00
committed by Timmy Willison
parent 31d58c5cbb
commit 598ed050f6
2 changed files with 23 additions and 0 deletions

View File

@@ -627,6 +627,12 @@ jQuery.extend({
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
}
// If request was aborted inside ajaxSend, stop there
if ( state === 2 ) {
return jqXHR;
}
// Timeout
if ( s.async && s.timeout > 0 ) {
timeoutTimer = setTimeout(function() {