href + download方法
當我們使用a標籤鏈接要下載的.txt或者.log等文件時,總是瀏覽器直接打開了文件而不是下載解決方式如下:給a標籤添加一個download屬性
<a href="/upload/aaa.txt" download>
其中download可以給值也可以不給值
自己嘗試一下
當我們使用a標籤鏈接要下載的.txt或者.log等文件時,總是瀏覽器直接打開了文件而不是下載解決方式如下:給a標籤添加一個download屬性
<a href="/upload/aaa.txt" download>
其中download可以給值也可以不給值
自己嘗試一下
(function(d, s, id) { let js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) retur