From c34a62f8abbd9598e7a6647754c449ce92418b3a Mon Sep 17 00:00:00 2001 From: jeresig Date: Mon, 14 Jun 2010 23:05:01 -0400 Subject: [PATCH] Tweak spacing from last commit. --- src/ajax.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) mode change 100644 => 100755 speed/benchmarker.css mode change 100644 => 100755 speed/benchmarker.js mode change 100644 => 100755 speed/index.html diff --git a/speed/benchmarker.css b/speed/benchmarker.css old mode 100644 new mode 100755 diff --git a/speed/benchmarker.js b/speed/benchmarker.js old mode 100644 new mode 100755 diff --git a/speed/index.html b/speed/index.html old mode 100644 new mode 100755 diff --git a/src/ajax.js b/src/ajax.js index ffd870c..47f243e 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -238,23 +238,24 @@ jQuery.extend({ // Handle JSONP-style loading var customJsonp = window[ jsonp ]; + window[ jsonp ] = function( tmp ) { data = tmp; jQuery.ajax.handleSuccess( s, xhr, status, data ); jQuery.ajax.handleComplete( s, xhr, status, data ); if ( jQuery.isFunction( customJsonp ) ) { - customJsonp( tmp ); - } - else { - // Garbage collect - window[ jsonp ] = undefined; - - try { - delete window[ jsonp ]; - } catch( jsonpError ) {} - } - + customJsonp( tmp ); + + } else { + // Garbage collect + window[ jsonp ] = undefined; + + try { + delete window[ jsonp ]; + } catch( jsonpError ) {} + } + if ( head ) { head.removeChild( script ); } @@ -444,8 +445,9 @@ jQuery.extend({ // Fire the complete handlers if ( !jsonp ) { - jQuery.ajax.handleComplete( s, xhr, status, data ); - } + jQuery.ajax.handleComplete( s, xhr, status, data ); + } + if ( isTimeout === "timeout" ) { xhr.abort(); } -- 1.7.10.4