X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=bf3c238473ece848385862d98dd29010a33ab560;hb=b721a2f472b53fec28276d2080d741cf070b686d;hp=80cabd32d65001efd52d1505abeea1603ce97c99;hpb=56a93fc2cce999ccfb0e3b80aeaa0f480ef7ae6e;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 80cabd3..bf3c238 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -34,6 +34,7 @@ jQuery.fn.extend({ jQuery.ajax({ url: url, type: type, + dataType: "html", data: params, complete: function(res, status){ // If successful, inject the HTML into all the matched elements @@ -150,7 +151,7 @@ jQuery.extend({ lastModified: {}, ajax: function( s ) { - var jsonp, jsre = /=(\?|%3F)/g, status, data; + var jsonp, jsre = /=\?(&|$)/g, status, data; // Extend the settings, but re-extend 's' so that it can be // checked again later (in the test suite, specifically) @@ -223,6 +224,8 @@ jQuery.extend({ var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = s.url; + if (s.scriptCharset) + script.charset = s.scriptCharset; // Handle Script loading if ( !jsonp ) { @@ -243,7 +246,7 @@ jQuery.extend({ head.appendChild(script); // We handle everything using the script element injection - return; + return undefined; } var requestDone = false; @@ -358,9 +361,6 @@ jQuery.extend({ // firefox 1.5 doesn't fire statechange for sync requests if ( !s.async ) onreadystatechange(); - - // return XMLHttpRequest to allow aborting the request etc. - return xml; function success(){ // If a local callback was specified, fire it and pass it the data @@ -385,6 +385,9 @@ jQuery.extend({ if ( s.global && ! --jQuery.active ) jQuery.event.trigger( "ajaxStop" ); } + + // return XMLHttpRequest to allow aborting the request etc. + return xml; }, handleError: function( s, xml, status, e ) {