onClick="top.frames('frame1').document.execCommand('saveAs');"

解决方案 »

  1.   

    <body>
    <script language="JavaScript">
    <!--
    function ISave() /*----*/
    {
      return document.frames("frame1").document.execCommand('saveAs');
    }
    //-->
    </script>
    <iframe name="frame1" src="test.htm" width="300" height="200"></iframe>
    <iframe name="frame2" src="test2.htm" width="300" height="200"></iframe>
    <br>
    <input type="button" value="dddddd" onClick="ISave();">
    <!--将只保存test.htm-->
    </body>