X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax.js;h=4714afdae1c43138e31174585288ed27ad5130a6;hb=2d0bc7ce72ab8d64da0506a88c8cc543ce3ceaba;hp=7ef8dec186669fc26a759b44f55e7036f03ae466;hpb=d4790116b8ff83786e82767cba23a4bff0236e58;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 7ef8dec..4714afd 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):$/, @@ -19,7 +19,7 @@ var r20 = /%20/g, rucHeadersFunc = function( _, $1, $2 ) { return $1 + $2.toUpperCase(); }, - rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/, + rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?|\/[^\/])/, // Keep a copy of the old load method _load = jQuery.fn.load, @@ -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