X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax.js;h=6628b1f3977ab8ad963c7b526318434ed861f6b6;hb=feb9051c0e29937c2494c3db0862a671efc21747;hp=a5a08ecd6d210741013e78416ba88d5dee910676;hpb=06c2f06a2183ef17a8119ef25a383a02572c0b55;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index a5a08ec..6628b1f 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -224,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 ) { @@ -244,7 +246,7 @@ jQuery.extend({ head.appendChild(script); // We handle everything using the script element injection - return; + return undefined; } var requestDone = false; @@ -359,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 @@ -386,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 ) {