]> source.dussan.org Git - jquery.git/commitdiff
Handle issue with two concurrent JSONP requests that use the same callback name.
authorPinhook <contact@pinhooklabs.com>
Wed, 13 Oct 2010 14:30:19 +0000 (10:30 -0400)
committerjeresig <jeresig@gmail.com>
Wed, 13 Oct 2010 14:30:19 +0000 (10:30 -0400)
src/ajax.js

index d06bbabd94aa8e41b9b6da8b9a406c2dc68f226a..f3252ebc4bd624cd7cc91a49ea8035c5e1a78d66 100644 (file)
@@ -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 );
                        };
                }