Added in support for $.ajax jsonpCallback (allowing you to specify the name of the callback method - and allowing you to avoid skipping the cache). Fixes #4206.
This commit is contained in:
parent
aea5b09195
commit
fbc73d45b4
2 changed files with 34 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue