Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#14080 closed bug (plugin)

Running two JSONp calls with same jsonCallback simultaneous

Reported by: [email protected] Owned by:
Priority: high Milestone: 1.11/2.1
Component: ajax Version: 2.0.2
Keywords: Cc: jaubourg
Blocked by: Blocking:


Example: http://jsfiddle.net/MPtn6/

if you run two calls to a JSONp with the same pre-specified jsonCallback simultaneously, the second call will end with error "<Methodename> is not a function"

Change History (4)

comment:1 Changed 10 years ago by dmethvin

Cc: jaubourg added
Component: unfiledajax
Milestone: None1.10.2/2.0.3
Priority: undecidedhigh
Status: newopen

Corrected repro: http://jsfiddle.net/MPtn6/1/

In a quick look at ajax/jsonp.js it looks like we're saving and restoring the original callback, but since there is already a request in flight we restore it incorrectly the second time.

comment:2 Changed 9 years ago by dmethvin

Milestone: 1.10.2/

comment:3 Changed 9 years ago by jaubourg

Resolution: plugin
Status: openclosed

This was never supported nor is it supposed to be. If you want to do more advanced stuff with jsonp, use jQuery-JSONP: https://github.com/jaubourg/jquery-jsonp

comment:4 Changed 9 years ago by anonymous

Is it "advanced" to have two JSONp calls running at the same time?

At least it would be nice, to have no error raised.

Note: See TracTickets for help on using tickets.