<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>
posted on 2007-05-08 15:50  Caviare  阅读(568)  评论(0编辑  收藏  举报