<a href="javascript:DownLoad('images/1.jpg')">下载</a>
 <script>
  var frm = null;
  var timer = null
  function DownLoad(url)
  {
    frm = document.createElement("IFRAME");
    frm.style.display = "none";
    document.body.appendChild(frm);
    frm.contentWindow.location.href = url
   
    timer =  setInterval(checkload,200);
  
  }
  function checkload(){
    if( frm.contentWindow.document.readyState =="complete")
    {
        frm.contentWindow.document.execCommand("SaveAs");
       clearInterval(timer)}
       document.body.removeChild(frm);
    }
 </script>

相关文章:

  • 2022-01-26
  • 2021-09-10
  • 2022-02-15
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-31
  • 2022-01-23
相关资源
相似解决方案