1 <!DOCTYPE html> 2 <html> 3 <body> 4 <a download="suggested-filename" href="">link</a> 5 <script> 6 var anchorElement = document.querySelector('a[download]'); 7 url = window.location.href; 8 anchorElement.href = url.substr(url.indexOf('=') + 1); 9 anchorElement.click(); 10 </script> 11 </body> 12 </html> 13