aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-01-26 00:55:39 +0100
committerjaubourg <j@ubourg.net>2011-01-26 00:55:39 +0100
commit325dcdc2ab05173f809b9d83af59918b3695cc23 (patch)
tree861e2bfe79ecde358dadfa14873c8be321ece286
parent5ca8f0617f5c94495380ff783452a52eab706d39 (diff)
downloadjquery-325dcdc2ab05173f809b9d83af59918b3695cc23.tar.gz
jquery-325dcdc2ab05173f809b9d83af59918b3695cc23.zip
Fixes #8054 by reverting feature enhancement 5812 (4920). Regexps no longer searches for %3F in url or data to find jsonp callback placeholders.
-rw-r--r--src/ajax/jsonp.js2
-rw-r--r--test/unit/ajax.js21
2 files changed, 3 insertions, 20 deletions
diff --git a/src/ajax/jsonp.js b/src/ajax/jsonp.js
index f5742d998..16a4c2fd2 100644
--- a/src/ajax/jsonp.js
+++ b/src/ajax/jsonp.js
@@ -1,7 +1,7 @@
(function( jQuery ) {
var jsc = jQuery.now(),
- jsre = /(\=)(?:\?|%3F)(&|$)|()(?:\?\?|%3F%3F)()/i;
+ jsre = /(\=)\?(&|$)|()\?\?()/i;
// Default jsonp settings
jQuery.ajaxSetup({
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index d01837239..abe90c88e 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -1199,10 +1199,10 @@ test("jQuery.getScript(String, Function) - no callback", function() {
jQuery.each( [ "Same Domain", "Cross Domain" ] , function( crossDomain , label ) {
test("jQuery.ajax() - JSONP, " + label, function() {
- expect(17);
+ expect(16);
var count = 0;
- function plus(){ if ( ++count == 17 ) start(); }
+ function plus(){ if ( ++count == 16 ) start(); }
stop();
@@ -1310,23 +1310,6 @@ jQuery.each( [ "Same Domain", "Cross Domain" ] , function( crossDomain , label )
url: "data/jsonp.php",
dataType: "jsonp",
crossDomain: crossDomain,
- data: {
- callback: "?"
- },
- success: function(data){
- ok( data.data, "JSON results returned (GET, processed data callback)" );
- plus();
- },
- error: function(data){
- ok( false, "Ajax error JSON (GET, processed data callback)" );
- plus();
- }
- });
-
- jQuery.ajax({
- url: "data/jsonp.php",
- dataType: "jsonp",
- crossDomain: crossDomain,
jsonp: "callback",
success: function(data){
ok( data.data, "JSON results returned (GET, data obj callback)" );