<input type=button value=保存     onclick="mm()"><script language=javascript>
function mm()
{
  var url = parent.right.location.href;
  var w   = window.open(url, "_blank", "width=100,height=100");
  w.document.execCommand('SaveAs');
  w.close();
}
</script>

解决方案 »

  1.   

    <input type=button value=打印 onclick="mm()"><script language=javascript>
    function mm()
    {
      var str = Id.innerHTML;  var w   = window.open("", "_blank", "width=100,height=100");
      w.document.write(str);
      w.document.close();
      w.document.execCommand('Print');
      w.close();
    }
    </script>
      

  2.   

    为什么我用了很多方法,加了保存代码后,打印的时候总会出现http:///这样的空白页面。
      

  3.   

    为什么我用了很多方法,加了保存代码后,打印的时候总会出现http:///这样的空白页面。