Side navigation
#3603 closed feature (invalid)
Opened November 14, 2008 12:03AM UTC
Closed November 14, 2008 12:55AM UTC
JSONP callback with multiple parameters
Reported by: | ricardoe | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.3 |
Component: | ajax | Version: | 1.2.6 |
Keywords: | jsonp, parameters, callback | Cc: | ricardoe |
Blocked by: | Blocking: |
Description
JSONP callbacks only allow one parameter, I've modified the jQuery 1.2.6 code so I can use any number of parametes with the success function.
For Rev. 5891
Lines 2827 - 2828:
if ( s.success )
s.success( data, status );
Becomes:
if ( s.success ) {
data = jQuery.makeArray(data);
data.push(status);
s.success.apply(this,data);
}
And line 2629
data = tmp;
Now is:
data = arguments;
I hope this is revised and introduced, restrict the number of params you can send to a function is, IMHO not a good thing.
Sorry, this is my first bug report.
Attachments (0)
Change History (2)
Changed November 14, 2008 12:06AM UTC by comment:1
Changed November 14, 2008 12:55AM UTC by comment:2
cc: | → ricardoe |
---|---|
need: | Patch → Review |
priority: | major → minor |
resolution: | → invalid |
status: | new → closed |
type: | bug → feature |
Everyone uses JSONP with one single argument, $.ajax's success callback ALWAYS receives one argument.
I don't see any need to add this, you can simply pass an array of objects (or w/e) instead of just one element.
Sorry I screw the code.
Lines 2827 - 2828:
Becomes:
And line 2629:
Now is: