<input type=button value=保存     onclick="document.execCommand('SaveAs')">
<input type=button value=另存为   onclick="document.execCommand('Saveas',false,'c:\\test.htm')">

解决方案 »

  1.   

    不是保存网页,而是保存超链中所指的文件。
    例如<a href="http://localhost/test.txt">test</a>
    当点击此链接时,想保存text.txt。如果直接点的话就把test.txt在网页显示出来了,有什么办法解决吗?
      

  2.   

    <a href="#" onclick=document.execCommand("saveAs")>另存为</a>
      

  3.   

    哦,页面是你写的吗?如果是你写的,右键点击<a>后 在<a>的onclick上写成,self.location.replace(a.href)不就可以了?
      

  4.   

    我也顶一下
    谁知道 怎么保存图片?   谁知道用javascript实现IE中右键"图片保存为功能!!!IE6 本身有,我自己想编出来!@!!@@