I have 2 cross domain jsonp requests that need to be completed before another method can be executed. So I tried the $.when() function
$.when(getX(), getY()).then(createXY);
getX() and getY() make $.ajax() requests to two different domains with separate jsonp callbacks.
Contrary to my original thought, createXY() gets invoked before the callbacks return. createXY() therefore does not have the data it needs.
Can someone please provide me an example on invoking a function when multiple async jsonp requests are completed?