From: Pinhook Date: Wed, 13 Oct 2010 14:30:19 +0000 (-0400) Subject: Handle issue with two concurrent JSONP requests that use the same callback name. X-Git-Tag: 1.4.3~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=39addc87a37b32be19f2c58ec8babe752c0243e1;p=jquery.git Handle issue with two concurrent JSONP requests that use the same callback name. --- diff --git a/src/ajax.js b/src/ajax.js index d06bbabd9..f3252ebc4 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -239,10 +239,6 @@ jQuery.extend({ var customJsonp = window[ jsonp ]; window[ jsonp ] = function( tmp ) { - data = tmp; - jQuery.handleSuccess( s, xhr, status, data ); - jQuery.handleComplete( s, xhr, status, data ); - if ( jQuery.isFunction( customJsonp ) ) { customJsonp( tmp ); @@ -258,6 +254,10 @@ jQuery.extend({ if ( head ) { head.removeChild( script ); } + + data = tmp; + jQuery.ajax.handleSuccess( s, xhr, status, data ); + jQuery.ajax.handleComplete( s, xhr, status, data ); }; }