这个调用后弹出了保存当前html文档的对话框,那么其他文件的呢?比如图片?

解决方案 »

  1.   

    <!-- 鼠标左键直接下载图片 --><iframe id="frame1" style="display:none"></iframe>
    <script language="JScript">
    var n=0;
    function go(url){
    n==0?new function(){frames("frame1").location=url,n=1}:null;
    document.all("frame1").readyState!="complete"?setTimeout(go,10):so();
    function so(){frames("frame1").document.execCommand("SaveAs"),n=0};
    }
    </script>
    <img src="images/title.gif" onclick="go(src)">
      

  2.   

    <script>
    function getimg() {
    event.returnValue=false;
    show.window.location.href=event.srcElement.src;
    timer=setInterval(checkload,100)
    }
    function checkload(){
    if(show.readyState!="complete")
    {show.document.execCommand("SaveAs");
      clearInterval(timer)}
    }</script>
    <img src="1.jpg" oncontextmenu="getimg()">
    <iframe src="" name=show style="width:0;height:0"></iframe>
      

  3.   

    感谢 gaofaq(老高) 和 ghlfllz(风流浪子) 的回复,再请问一下readyStage属性以前没有用过,其作用是什么?
      

  4.   

    http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/readystate_2.asp