Commit b721a2f4 authored by John Resig's avatar John Resig

Added a fix for bug #2020 - if you want to do data: {callback: "?"}, do jsonp: "callback" instead.

parent 45e4a52c
...@@ -151,7 +151,7 @@ jQuery.extend({ ...@@ -151,7 +151,7 @@ jQuery.extend({
lastModified: {}, lastModified: {},
ajax: function( s ) { 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 // Extend the settings, but re-extend 's' so that it can be
// checked again later (in the test suite, specifically) // checked again later (in the test suite, specifically)
......
...@@ -449,7 +449,7 @@ test("$.ajax() - JSONP, Local", function() { ...@@ -449,7 +449,7 @@ test("$.ajax() - JSONP, Local", function() {
$.ajax({ $.ajax({
url: "data/jsonp.php", url: "data/jsonp.php",
dataType: "jsonp", dataType: "jsonp",
data: { callback: "?" }, jsonp: "callback",
success: function(data){ success: function(data){
ok( data.data, "JSON results returned (GET, data obj callback)" ); ok( data.data, "JSON results returned (GET, data obj callback)" );
plus(); plus();
...@@ -492,7 +492,7 @@ test("$.ajax() - JSONP, Local", function() { ...@@ -492,7 +492,7 @@ test("$.ajax() - JSONP, Local", function() {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "data/jsonp.php", url: "data/jsonp.php",
data: { callback: "?" }, jsonp: "callback",
dataType: "jsonp", dataType: "jsonp",
success: function(data){ success: function(data){
ok( data.data, "JSON results returned (POST, data obj callback)" ); ok( data.data, "JSON results returned (POST, data obj callback)" );
...@@ -558,7 +558,7 @@ test("$.ajax() - JSONP, Remote", function() { ...@@ -558,7 +558,7 @@ test("$.ajax() - JSONP, Remote", function() {
$.ajax({ $.ajax({
url: base + "data/jsonp.php", url: base + "data/jsonp.php",
dataType: "jsonp", dataType: "jsonp",
data: { callback: "?" }, jsonp: "callback",
success: function(data){ success: function(data){
ok( data.data, "JSON results returned (GET, data obj callback)" ); ok( data.data, "JSON results returned (GET, data obj callback)" );
plus(); plus();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment