From 1ad874f3447cdba89d77cfe00b10d6f1d7dcea4e Mon Sep 17 00:00:00 2001 From: jaubourg Date: Wed, 9 Jan 2013 11:04:03 +0100 Subject: [PATCH] Further script transport cleanup, close gh-1123. --- src/ajax/script.js | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/ajax/script.js b/src/ajax/script.js index b5d377571..a16e56dfa 100644 --- a/src/ajax/script.js +++ b/src/ajax/script.js @@ -25,30 +25,27 @@ jQuery.ajaxPrefilter( "script", function( s ) { }); // Bind script tag hack transport -jQuery.ajaxTransport( "script", function(s) { +jQuery.ajaxTransport( "script", function( s ) { // This transport only deals with cross domain requests if ( s.crossDomain ) { - var callback; + var script, callback; return { send: function( _, complete ) { - callback = function( type ) { - return function() { - callback = script.onload = script.onerror = null; - jQuery( script ).remove(); - if ( type ) { - complete( type === "success" ? 200 : 404, type ); + script = jQuery("