Repeat calls with jsonpCallback break

Repeat calls with jsonpCallback break

If you do a jsonp request followed by another jsonp request, with jsonpCallback set, the callback function is deleted before the second request completes.

Example:
  1. $.ajax({
  2.   url:  "1.json",
  3.   success: function(){
  4.     $.ajax({url: "2.json", jsonpCallback: "C", dataType: "jsonp", success: function(){} })
  5.   },
  6.   jsonpCallback: "C",
  7.   dataType: "jsonp"
  8. });
An easy solution would be to have the garbage collection happen before success is called.