If you change your code to use window.open() instead of window.location , you can run all three downloads at once.
I know that this does not satisfy the requirement of waiting for user input before presenting each of the downloads, but it does not correspond to the spirit of your source code. Hope this helps a bit.
function downloadFiles(){ var files = []; files.push('file1.txt'); files.push('file2.txt'); files.push('file3.txt'); for(var ii=0; ii<files.length; ii++){ window.open(files[ii]); } }
Chris source share