Hi,
Please refer to
Chaining promises for a detailed documentation.
Basically, what you need to do is:
WinJS.xhr({/* your current options for the first call */}).then(function(result){
//handle result
return WinJS.xhr({/* options for the second call */});
}).then(function(secondResult){
//handle second result
return WinJS.xhr({/* options for the third call */});
}).then(function(thirdResult){
//handle third result
return WinJS.xhr({/* options for the fourth call */});
}).done(function(fourthResult){
//handle fourth call
});
That's an example of chaining 4 xhr's that depend on each other, always remember to end the chain with a "done". If you just want to fire N xhr's on parallel and do something when all of them finish (in any order), you can take a look at
WinJS.Promise.join.