如何在用户单击链接时提示下载.
例如,而不是:
<a href="uploads/file.doc">Download Here</a>
Run Code Online (Sandbox Code Playgroud)
我可以用:
<a href="#">Download Here</a>
$('a').click... //Some jquery to download the file
Run Code Online (Sandbox Code Playgroud)
这样,Google就不会将我的HREF和私人文件编入索引.
这可以用jQuery完成,如果是这样,怎么样?或者应该用PHP或其他东西来完成?