Skip to main content

Bug Tracker

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 ricardoe comment:1

Sorry I screw the code.

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; 

Changed November 14, 2008 12:55AM UTC by flesler comment:2

cc: → ricardoe
need: PatchReview
priority: majorminor
resolution: → invalid
status: newclosed
type: bugfeature

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.