X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=src%2Fajax%2Fscript.js;h=645ddf3355403d297719aa08c1e169cc913197f3;hp=75f34fce20b6bc753b6a79f937fd6173e0e8e9db;hb=667a3b31e6a27cfe3f209765d583bff584ecc2f6;hpb=b07d43c649240a78f5e832e2825db3af87357932 diff --git a/src/ajax/script.js b/src/ajax/script.js index 75f34fc..645ddf3 100644 --- a/src/ajax/script.js +++ b/src/ajax/script.js @@ -47,7 +47,7 @@ jQuery.ajax.transport("script", function(s) { script.src = s.url; // Attach handlers for all browsers - script.onload = script.onreadystatechange = function( _ , statusText) { + script.onload = script.onreadystatechange = function( _ , isAbort ) { if ( ! script.readyState || /loaded|complete/.test( script.readyState ) ) { @@ -59,10 +59,13 @@ jQuery.ajax.transport("script", function(s) { head.removeChild( script ); } + // Dereference the script script = 0; - // Callback - callback( statusText ? 0 : 200, statusText || "success" ); + // Callback if not abort + if ( ! isAbort ) { + callback( 200, "success" ); + } } }; // Use insertBefore instead of appendChild to circumvent an IE6 bug. @@ -70,9 +73,9 @@ jQuery.ajax.transport("script", function(s) { head.insertBefore( script, head.firstChild ); }, - abort: function(statusText) { + abort: function() { if ( script ) { - script.onload( 0 , statusText ); + script.onload(0,1); } } };