When synchronizing ajax requests, example:
$.when(
$.get("/api/foo", { prm: 1 }),
$.get("/api/bar", { prm: 2 })
).done(function (data1, data2) {
doStuff(data1[0].Value, data2[0].Value);
});
I am getting result objects from the deferred $.get call, that are different to what I am getting when simply calling $.get:
$.get("/api/foo", { prm: 1 }, function (data) { doStuff(data.Value); });
Basically the information that I need is at index 0 of the objects passed to done() (and there is a "success" string at index 1 and raw data at index 2).
I would like to know when and how the result object is being altered this way and if it is safe to always look out for the data at index 0.