Prova questo...
File : test82a.html
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<div id="my_div">
stampa di un altra pagina window.print()
su click di un pulsatne esegui window.print() vi chiedo è possibile anzichè stampare la pagina correntemente visibile stamparne un altra che preparo uguale ma senza pulsanti ecc...
Grazie.
</div>
<input type="button" name="btn" value="Print Preview" onclick="window.open('test82b.html', null, 'HEIGHT=225,resizable=yes,WIDTH=400');"/>
</body>
</html>
File : test82b.html
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
.btn {}
-->
</style>
<script language="JavaScript" type="text/javascript">
<!--
function myBeforePrintFunction() {
document.all.btn.style.visibility = "hidden";
} // function myBeforePrintFunction()
function myAfterPrintFunction() {
document.all.btn.style.visibility = "visible";
} // function myAfterPrintFunction()
window.onbeforeprint = myBeforePrintFunction;
window.onafterprint = myAfterPrintFunction;
//-->
</script>
</head>
<body>
<input class="btn" type="button" name="btn" value="Print" onclick="window.print();"/>
<script language="JavaScript" type="text/javascript">
<!--
document.write(window.opener.document.all.my_div.outerHTML);
//-->
</script>
</body>
</html>