添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
重情义的单杠  ·  在 JavaScript 中获取 ...·  2 周前    · 
博学的鸵鸟  ·  中国铁路网-铜九铁路·  3 月前    · 
不羁的硬盘  ·  Uninstall the Brother ...·  3 月前    · 
追风的凳子  ·  Homebrew is dead for ...·  4 月前    · 
长情的斑马  ·  Dynamics Community ...·  7 月前    · 

Lets say i have two links to same file called “cat.avi”

<a href=“ http://site.com/cat.avi ”>Play Movie</a>

<a href=“ http://site.com/cat.avi ”>Download Movie</a>

when the user clicks the second link, how can i make the file to be prompted for a download, instead of opening the cat.avi file with the windows media player or what ever?

try this (IE Only I beleive)

<button onclick="javascript:document.execCommand('SaveAs','1','fileName.txt')">Click to save</Button>

Reference