converters: {
"text script": jQuery.globalEval
}
-});
// Bind script tag hack transport
-jQuery.ajax.transport("script", function(s) {
+}).ajaxTransport("script", function(s) {
// Handle cache special case
if ( s.cache === undefined ) {
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 ) ) {
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.
head.insertBefore( script, head.firstChild );
},
- abort: function(statusText) {
+ abort: function() {
if ( script ) {
- script.onload( 0 , statusText );
+ script.onload(0,1);
}
}
};