I have two ajax $.get() requests that I need to synchronize.
Essentially
var signal1 = false;
var signal2 = false;
$.get(url,
{},
function (data) {
signal1 = true;//callback complete.
},'json');
$.get(url2,
{},
function (data) {
signal2 = true;//callback complete.
},'json');
when(signal1 && signal2 == true)
$.get(url3...
How can I, should I accomplish this type of task? (Bonus, what’s the AJAX signature for failure callback?)
You do it like this:
See
jQuery.when: http://api.jquery.com/jQuery.when/