]> source.dussan.org Git - jquery.git/commitdiff
Gets rid of a var statement by moving variable declarations up.
authorjaubourg <j@ubourg.net>
Wed, 12 Jan 2011 23:41:10 +0000 (00:41 +0100)
committerjaubourg <j@ubourg.net>
Wed, 12 Jan 2011 23:41:10 +0000 (00:41 +0100)
src/ajax.js

index 968c67c8ac8917251d00e0f07c3c1b3d92723328..a2b934d75d24fe6df92c378aaa878ab97e6f9e88 100644 (file)
@@ -274,6 +274,9 @@ jQuery.extend({
                        transport,
                        // timeout handle
                        timeoutTimer,
+                       // Cross-domain detection vars
+                       loc = document.location,
+                       parts,
                        // The jXHR state
                        state = 0,
                        // Loop variable
@@ -527,10 +530,8 @@ jQuery.extend({
                s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( /\s+/ );
 
                // Determine if a cross-domain request is in order
-               var parts = rurl.exec( s.url.toLowerCase() ),
-                       loc = location;
-
                if ( ! s.crossDomain ) {
+                       parts = rurl.exec( s.url.toLowerCase() );
                        s.crossDomain = !!(
                                        parts &&
                                        ( parts[ 1 ] && parts[ 1 ] != loc.protocol ||