如何使用锚标签下载文件< a> [英] how to download file using anchor tag <a>
本文介绍了如何使用锚标签下载文件< a>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么这不起作用:
download.html
< a href =jsplogin.jar>下载< / a>
jsplogin.jar文件位于同一个文件夹中,具有download.html文件
就在昨天它已经工作了
当我点击下载链接时,文件jsplogin.jar应该下载
,但它的尝试在浏览器中打开文件。
当我右键点击链接并选择保存链接时,什么也没有发生。
$ b
< a href =http://www.example.com/index.html下载>下载< / a>
基于这个问题。 如何在html中创建下载链接?
why is this not working:
download.html
<a href="jsplogin.jar">download</a>
the jsplogin.jar file is in the same folder has the download.html file
just yesterday it had worked
when i click the download link the file jsplogin.jar should download but its trying to open the file in the browser. when i right clicked on the link and selected "save link" nothing is happening
解决方案
In HTML5, in most browsers you can add a 'download' attribute to the a
element.
for example:
<a href="http://www.example.com/index.html" download>Download</a>
Based on this question. How can I create download link in html?
这篇关于如何使用锚标签下载文件< a>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文