PDA

View Full Version : opening a new window and printing it


hatton_james
11-05-2002, 04:05 PM
What I'm looking for is a script which opens a new window and then prints the contents of that window. Is it possible to pass window.print() the name of the new window?

A solution i think would be to put a function in the new window which specifies the printing method.. window.print() and onload that function. However HOW do I do that?

thanks!

cg9com
11-05-2002, 04:12 PM
possibly this could help, to call a function you can do the following

<script language="javascript" type="text/javascript">
function functionname() {
desired action
}
</script>


then add an onload tag, in the body perhaps

<body onload="functionname()">