我尝试下载文件时,用户点击“下载喜欢”.I找到这个链接.it打开file.Not开始自动下载文件。Download File Using jQuery.\
http://jsfiddle.net/fXwqA/
$('a').click(function(e) {
e.preventDefault(); //stop the browser from following
window.location.href = 'http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css';
});
它应该自动开始下载。
发布于 2014-05-26 23:09:33
没有必要在jQuery中添加“下载”属性到您的锚:
<a download href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
Download now!
</a>
演示:http://jsfiddle.net/ygalanter/fXwqA/1/
https://stackoverflow.com/questions/23878677
复制相似问题