不再新打开网页来做保存不好实现,如果你仅仅是为了不让客户看到这个新的网页,那么这样做吧:
var oWin=window.open("","","top=2000,left=2000");
with(oWin) {
document.write( document.yourFrameName.body.innerHTML );
document.execCommand('Saveas',false , "test.txt" );
close();
}

解决方案 »

  1.   

    top.yourFrameName.document.execCommand('Saveas',false , "test.txt" );
      

  2.   

    我这是第一次来,就能这么快地解决了问题。真的很感激各位啊!:)最后的解决方法是:
    var oWin=window.open ('b2.htm','','top=2000,left=2000');
    with(oWin) {
    document.execCommand('Saveas',false , "test.txt" );
    close();
    }提醒一下:
    如果使用top.yourFrameName.document.execCommand('Saveas',false  ,    "test.txt  "  );保存的将还是框架的信息。 
    另外想问一下:为什么document.write(  document.yourFrameName.body.innerHTML  );  用起来报错呢?说:“document.yourFrameName.body不是对象”,这句不要会怎么样?