diff options
author | jaubourg <j@ubourg.net> | 2011-01-13 00:41:10 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-01-13 00:41:10 +0100 |
commit | e9fb7d5be6e079aaa2cf0c3092c6f15cd1285bf4 (patch) | |
tree | 8ea5883a2a5298d22ed8722747d54eebd1f94a5b /src/ajax.js | |
parent | e221d39e981ceac030d2e0431570742fb51337d5 (diff) | |
download | jquery-e9fb7d5be6e079aaa2cf0c3092c6f15cd1285bf4.tar.gz jquery-e9fb7d5be6e079aaa2cf0c3092c6f15cd1285bf4.zip |
Gets rid of a var statement by moving variable declarations up.
Diffstat (limited to 'src/ajax.js')
-rw-r--r-- | src/ajax.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ajax.js b/src/ajax.js index 968c67c8a..a2b934d75 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -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 || |