<a href="picName.jpg" id=pic1 onclick="savepic();return false;" style="cursor:hand">点击下载</a> 
function savepic() { 
  if (document.all.a1 == null) { 
    objIframe = document.createElement("IFRAME"); 
    document.body.insertBefore(objIframe); 
    objIframe.outerHTML = "<iframe name=a1 style='width:400px;hieght:300px' src=" + imageName.href + "></iframe>"; 
    re = setTimeout("savepic()", 1) 
  } else { 
    clearTimeout(re) 
    pic = window.open(imageName.href, "a1") 
    pic.document.execCommand("SaveAs") 
    document.all.a1.removeNode(true) 
  } 
} 

 

相关文章:

  • 2022-01-06
  • 2022-12-23
  • 2021-05-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2022-12-23
  • 2022-02-27
  • 2022-02-03
相关资源
相似解决方案