X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax.js;h=6628b1f3977ab8ad963c7b526318434ed861f6b6;hb=feb9051c0e29937c2494c3db0862a671efc21747;hp=80cabd32d65001efd52d1505abeea1603ce97c99;hpb=56a93fc2cce999ccfb0e3b80aeaa0f480ef7ae6e;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 80cabd3..6628b1f 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 @@ -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 ) {