function download(link) { var $a = $("<a></a>").attr("href", link).attr("download", ""); $a[0].click(); }