X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=bffbeb607e66ddaba235968d7442314c2cb9f88f;hb=e10e625bf4865cb8e9927e94d15afa37f6537a03;hp=0f5f80529a90321616f7d3f56a1577d976faf011;hpb=ca79d866fe07302f03df2b3db09c886c6abef9ff;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 0f5f805..bffbeb6 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -95,7 +95,7 @@ jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".sp var jsc = now(); jQuery.extend({ - + get: function( url, data, callback, type ) { // shift arguments if data argument was ommited if ( jQuery.isFunction( data ) ) { @@ -233,9 +233,6 @@ jQuery.extend({ // If data is available, append data to url for get requests if ( s.data && type == "GET" ) { s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; - - // IE likes to send both get and post data, prevent this - s.data = null; } // Watch for a new set of requests @@ -275,7 +272,9 @@ jQuery.extend({ }; } - head.appendChild(script); + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709 and #4378). + head.insertBefore( script, head.firstChild ); // We handle everything using the script element injection return undefined; @@ -407,7 +406,7 @@ jQuery.extend({ // Send the data try { - xhr.send(s.data); + xhr.send( type === "POST" ? s.data : null ); } catch(e) { jQuery.handleError(s, xhr, null, e); } @@ -484,7 +483,7 @@ jQuery.extend({ if ( xml && data.documentElement.tagName == "parsererror" ) throw "parsererror"; - + // Allow a pre-filtering function to sanitize the response // s != null is checked to keep backwards compatibility if( s && s.dataFilter ) @@ -501,7 +500,7 @@ jQuery.extend({ if ( type == "json" ) data = window["eval"]("(" + data + ")"); } - + return data; },