X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax.js;h=6414e8c2990e8e9d07a4cfce056a1b896c1b2522;hb=a43a5ca9cf79afcd662df5b9110d7ccba45c0b53;hp=7ef8dec186669fc26a759b44f55e7036f03ae466;hpb=d4790116b8ff83786e82767cba23a4bff0236e58;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 7ef8dec..6414e8c 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -4,7 +4,7 @@ var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rhash = /#.*$/, - rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /(?:^file|^widget|\-extension):$/, @@ -164,7 +164,7 @@ jQuery.fn.extend({ if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; - params = null; + params = undefined; // Otherwise, build a param string } else if ( typeof params === "object" ) { @@ -256,7 +256,7 @@ jQuery.each( [ "get", "post" ], function( i, method ) { if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; - data = null; + data = undefined; } return jQuery.ajax({ @@ -272,7 +272,7 @@ jQuery.each( [ "get", "post" ], function( i, method ) { jQuery.extend({ getScript: function( url, callback ) { - return jQuery.get( url, null, callback, "script" ); + return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { @@ -439,7 +439,7 @@ jQuery.extend({ } match = responseHeaders[ key.toLowerCase() ]; } - return match || null; + return match === undefined ? null : match; }, // Overrides response content-type header