From: John Resig Date: Mon, 25 Oct 2010 20:06:55 +0000 (-0700) Subject: Merge branch 'jquerymaster' of http://github.com/SlexAxton/jquery into SlexAxton... X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=a4fc842019a678a331c7322a5be747e6adc426ca;hp=-c;p=jquery.git Merge branch 'jquerymaster' of github.com/SlexAxton/jquery into SlexAxton-jquerymaster --- a4fc842019a678a331c7322a5be747e6adc426ca diff --combined src/ajax.js index 6a757eb,d6c35d4..b39bc8d --- a/src/ajax.js +++ b/src/ajax.js @@@ -4,7 -4,7 +4,7 @@@ var jsc = jQuery.now() rscript = /)<[^<]*)*<\/script>/gi, rselectTextarea = /^(?:select|textarea)/i, rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, - rnoContent = /^(?:GET|HEAD|DELETE)$/, + rnoContent = /^(?:GET|HEAD)$/, rbracket = /\[\]$/, jsre = /\=\?(&|$)/, rquery = /\?/, @@@ -208,12 -208,6 +208,12 @@@ jQuery.extend( s.data = jQuery.param( s.data, s.traditional ); } + // If the jsonpCallback has been set, we can assume that dataType is jsonp + // Ticket #5803 + if ( s.jsonpCallback ) { + s.dataType = "jsonp"; + } + // Handle JSONP Parameter Callbacks if ( s.dataType === "jsonp" ) { if ( type === "GET" ) { @@@ -271,7 -265,7 +271,7 @@@ s.cache = false; } - if ( s.cache === false && type === "GET" ) { + if ( s.cache === false && noContent ) { var ts = jQuery.now(); // try replacing _= if it is there @@@ -281,8 -275,8 +281,8 @@@ s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); } - // If data is available, append data to url for get requests - if ( s.data && type === "GET" ) { + // If data is available, append data to url for GET/HEAD requests + if ( s.data && noContent ) { s.url += (rquery.test(s.url) ? "&" : "?") + s.data; } @@@ -293,7 -287,7 +293,7 @@@ // Matches an absolute URL, and saves the domain var parts = rurl.exec( s.url ), - remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host); + remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host); // If we're requesting a remote document // and trying to load JSON or Script with a GET