When attempting to send multiple XHR requests, it appears that each request is being queued and waits for the previous one to finish before proceeding. Is there a way to make simultaneous XHR requests?
$('body').delegate('.download','click', function(evt){
evt.preventDefault(); // Not related
var xhr = new XMLHttpRequest();
xhr.open('GET', "proxy.php?" + this.href, true);
xhr.responseType = 'blob';
xhr.onload = function() {
if (this.status == 200) {
var blob = new Blob([this.response], {type:'audio/mp4'});
console.log(blob.size);
if(blob.size > 0){
$("<a>").attr({
download: name,
href: URL.createObjectURL(blob),
target: "_blank"
})[0].click();
}
}
};
xhr.send();
});