X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=7c5c83888bb2fd2d6b121ddff5bbd800021d395d;hb=fbc73d45b487dd863886c7fd3f0af1fd4dec261b;hp=568a75dce1a8df9cec9a1b52a185599cac7a9daa;hpb=aea5b091954b3c823b318b392660b22c7b1e978a;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 568a75d..7c5c838 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -221,7 +221,7 @@ jQuery.extend({ // Build temporary JSONP function if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) { - jsonp = "jsonp" + jsc++; + jsonp = s.jsonpCallback || ("jsonp" + jsc++); // Replace the =? sequence both in the query string and the data if ( s.data ) { @@ -235,7 +235,7 @@ jQuery.extend({ s.dataType = "script"; // Handle JSONP-style loading - window[ jsonp ] = function(tmp){ + window[ jsonp ] = window[ jsonp ] || function(tmp){ data = tmp; success(); complete();