Skip to content

Commit

Permalink
Gets rid of a var statement by moving variable declarations up.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaubourg committed Jan 12, 2011
1 parent e221d39 commit e9fb7d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ajax.js
Expand Up @@ -274,6 +274,9 @@ jQuery.extend({
transport, transport,
// timeout handle // timeout handle
timeoutTimer, timeoutTimer,
// Cross-domain detection vars
loc = document.location,
parts,
// The jXHR state // The jXHR state
state = 0, state = 0,
// Loop variable // Loop variable
Expand Down Expand Up @@ -527,10 +530,8 @@ jQuery.extend({
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( /\s+/ ); s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( /\s+/ );


// Determine if a cross-domain request is in order // Determine if a cross-domain request is in order
var parts = rurl.exec( s.url.toLowerCase() ),
loc = location;

if ( ! s.crossDomain ) { if ( ! s.crossDomain ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( s.crossDomain = !!(
parts && parts &&
( parts[ 1 ] && parts[ 1 ] != loc.protocol || ( parts[ 1 ] && parts[ 1 ] != loc.protocol ||
Expand Down

0 comments on commit e9fb7d5

Please sign in to comment.