]> source.dussan.org Git - jquery.git/commitdiff
Added a fix for bug #2020 - if you want to do data: {callback: "?"}, do jsonp: "callb...
authorJohn Resig <jeresig@gmail.com>
Mon, 17 Dec 2007 00:44:00 +0000 (00:44 +0000)
committerJohn Resig <jeresig@gmail.com>
Mon, 17 Dec 2007 00:44:00 +0000 (00:44 +0000)
src/ajax.js
test/unit/ajax.js

index 6628b1f3977ab8ad963c7b526318434ed861f6b6..bf3c238473ece848385862d98dd29010a33ab560 100644 (file)
@@ -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)
index c231673b3b399da09c99ff050c4938571fcec2d8..8dcf7591e65b6385e8d767911d48db3715230c38 100644 (file)
@@ -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();