aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-12-17 00:44:00 +0000
committerJohn Resig <jeresig@gmail.com>2007-12-17 00:44:00 +0000
commitb721a2f472b53fec28276d2080d741cf070b686d (patch)
treef2f6c54aff4f38ac8e7887ff26f406b7faca890e
parent45e4a52cdd094134c4595b0ff017b7a9d6a8243c (diff)
downloadjquery-b721a2f472b53fec28276d2080d741cf070b686d.tar.gz
jquery-b721a2f472b53fec28276d2080d741cf070b686d.zip
Added a fix for bug #2020 - if you want to do data: {callback: "?"}, do jsonp: "callback" instead.
-rw-r--r--src/ajax.js2
-rw-r--r--test/unit/ajax.js6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ajax.js b/src/ajax.js
index 6628b1f39..bf3c23847 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -151,7 +151,7 @@ jQuery.extend({
lastModified: {},
ajax: function( s ) {
- var jsonp, jsre = /=(\?|%3F)/g, status, data;
+ var jsonp, jsre = /=\?(&|$)/g, status, data;
// Extend the settings, but re-extend 's' so that it can be
// checked again later (in the test suite, specifically)
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index c231673b3..8dcf7591e 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -449,7 +449,7 @@ test("$.ajax() - JSONP, Local", function() {
$.ajax({
url: "data/jsonp.php",
dataType: "jsonp",
- data: { callback: "?" },
+ jsonp: "callback",
success: function(data){
ok( data.data, "JSON results returned (GET, data obj callback)" );
plus();
@@ -492,7 +492,7 @@ test("$.ajax() - JSONP, Local", function() {
$.ajax({
type: "POST",
url: "data/jsonp.php",
- data: { callback: "?" },
+ jsonp: "callback",
dataType: "jsonp",
success: function(data){
ok( data.data, "JSON results returned (POST, data obj callback)" );
@@ -558,7 +558,7 @@ test("$.ajax() - JSONP, Remote", function() {
$.ajax({
url: base + "data/jsonp.php",
dataType: "jsonp",
- data: { callback: "?" },
+ jsonp: "callback",
success: function(data){
ok( data.data, "JSON results returned (GET, data obj callback)" );
plus();