<p><img id=pic1 src=test.gif onclick=savepic() style="cursor:hand">点击另存[要在同一域]</p>
<script>
function savepic(){if(document.all.a1==null){
objIframe=document.createElement("IFRAME");
document.body.insertBefore(objIframe);
objIframe.outerHTML= "<iframe name=a1 style='width:0;hieght:0' src="+pic1.src+"></iframe>";
re=setTimeout("savepic()",1)
}
else{
clearTimeout(re)
pic = window.open(pic1.src,"a1")
pic.document.execCommand("SaveAs")
document.all.a1.removeNode(true)
}}
</script>
----------------------------------------------------------
参考:http://community.csdn.net/Expert/topic/4445/4445092.xml?temp=.2883112