Run multiple AJAX requests in parallel

Some times it is best idea to issue multiple Ajax request in parallel. Without waiting one request to be completed we can issue multiple request using jquery when method


$.when($.get('files/1.json'), $.get('files/2.json')).then(function(r1, r2){
log(r1[0].message + " " + r2[0].message);
});