From 8ad22a2b152f55b12385b126305383e2c5ba1994 Mon Sep 17 00:00:00 2001 From: jaubourg Date: Mon, 23 Apr 2012 00:07:15 +0200 Subject: [PATCH] Prevents tests for replaceInData to take place if replaceInUrl is already true. --- src/ajax/jsonp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ajax/jsonp.js b/src/ajax/jsonp.js index 6b82b8262..3e3ea85a3 100644 --- a/src/ajax/jsonp.js +++ b/src/ajax/jsonp.js @@ -23,7 +23,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { url = s.url, hasCallback = s.jsonp !== false, replaceInUrl = hasCallback && rjsonp.test( url ), - replaceInData = hasCallback && typeof data === "string" && + replaceInData = hasCallback && !replaceInUrl && typeof data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( data );