Collect Multiple JSONP Results
I have a javascript application that gets data from multiple jsonp
requests. Once all of the data is returned the page will be updated with
the new data. Below is pseudocode, but it's structured for a synchronous
environment.
function GetAllData() {
var data1= GetData1();
var data2= GetData2();
var data3= GetData3();
UpdatePage(data1,data2,data3);
}
The issue I have is that I need to collect, and know, when all the data
has been returned from the jsonp requests before I update the page. I was
looking at jquery deferred, but I'm not sure if that's the correct
solution.
Any suggestions would be appreciated.
No comments:
Post a Comment