Changeset 5605
- Timestamp:
- 05/15/08 14:16:19 (8 months ago)
- Files:
-
- 1 modified
-
trunk/jquery/src/ajax.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/ajax.js
r5604 r5605 166 166 167 167 ajax: function( s ) { 168 var jsonp, jsre = /=\?(&|$)/g, status, data;169 170 168 // Extend the settings, but re-extend 's' so that it can be 171 169 // checked again later (in the test suite, specifically) 172 170 s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); 173 171 172 var jsonp, jsre = /=\?(&|$)/g, status, data, 173 type = s.type.toUpperCase(); 174 174 175 // convert data if not already a string 175 176 if ( s.data && s.processData && typeof s.data != "string" ) … … 178 179 // Handle JSONP Parameter Callbacks 179 180 if ( s.dataType == "jsonp" ) { 180 if ( s.type.toLowerCase() == "get" ) {181 if ( type == "GET" ) { 181 182 if ( !s.url.match(jsre) ) 182 183 s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; … … 215 216 s.cache = false; 216 217 217 if ( s.cache === false && s.type.toLowerCase() == "get" ) {218 if ( s.cache === false && type == "GET" ) { 218 219 var ts = now(); 219 220 // try replacing _= if it is there … … 224 225 225 226 // If data is available, append data to url for get requests 226 if ( s.data && s.type.toLowerCase() == "get" ) {227 if ( s.data && type == "GET" ) { 227 228 s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; 228 229 … … 240 241 // If we're requesting a remote document 241 242 // and trying to load JSON or Script with a GET 242 if ( s.dataType == "script" && s.type.toLowerCase() == "get"243 if ( s.dataType == "script" && type == "GET" 243 244 && remote.test(s.url) && remote.exec(s.url)[1] != location.host ){ 244 245 var head = document.getElementsByTagName("head")[0]; … … 279 280 // Passing null username, generates a login popup on Opera (#2865) 280 281 if( s.username ) 281 xml.open( s.type, s.url, s.async, s.username, s.password);282 xml.open(type, s.url, s.async, s.username, s.password); 282 283 else 283 xml.open( s.type, s.url, s.async);284 xml.open(type, s.url, s.async); 284 285 285 286 // Need an extra try/catch for cross domain requests in Firefox 3
