From ea3e10a49207f76957b5bd87095634882d5d374b Mon Sep 17 00:00:00 2001 From: jaubourg Date: Sat, 12 Feb 2011 00:13:38 +0100 Subject: [PATCH] Minor changes to enforce JQuery Core Style Guidelines. --- src/ajax.js | 2 +- src/ajax/xhr.js | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/ajax.js b/src/ajax.js index b35952f0b..790585dd0 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -451,7 +451,7 @@ jQuery.extend({ // Callback for when everything is done // It is defined here because jslint complains if it is declared // at the end of the function (which would be more logical and readable) - function done( status, statusText, responses, headers) { + function done( status, statusText, responses, headers ) { // Called once if ( state === 2 ) { diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 9c8790aba..a6473dd87 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -26,7 +26,7 @@ function createStandardXHR() { function createActiveXHR() { try { - return new window.ActiveXObject("Microsoft.XMLHTTP"); + return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) {} } @@ -166,14 +166,16 @@ if ( jQuery.support.ajax ) { } // Filter status for non standard behaviors - status = - // If the request is local and we have data: assume a success - // (success with no data won't get notified, that's the best we - // can do given current implementations) - !status && s.isLocal && !s.crossDomain ? - ( responses.text ? 200 : 404 ) : - // IE - #1450: sometimes returns 1223 when it should be 204 - ( status === 1223 ? 204 : status ); + + // If the request is local and we have data: assume a success + // (success with no data won't get notified, that's the best we + // can do given current implementations) + if ( !status && s.isLocal && !s.crossDomain ) { + status = responses.text ? 200 : 404; + // IE - #1450: sometimes returns 1223 when it should be 204 + } else if ( status === 1223 ) { + status = 204; + } } } } catch( firefoxAccessException ) { -- 2.39.5