You also can print windows and frames using the print method like this: window .print() . The print method opens the Print dialog box, prompting the user to change print settings and click OK to print. The Netscape Navigator 4.0 for Windows prints only the current frame. Netscape Navigator 6.0 enables you to print all frames if you use the print method from the <FRAMESET> window. Internet Explorer gives you the option of printing all frames or a specific frame. Tip When the user clicks the OK button in the Internet Explorer's Print dialog box, the following sequence of events occurs: The onbeforeprint event occurs, the document prints, and then the onafterprint event occurs. These events are not supported in the Netscape Navigator. Here's an example that prints the current window: (Listing 08-07.html on the web site)<HTML> <HEAD> <TITLE> Printing a Window </TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function printer() { window.print() } // --> </SCRIPT> </HEAD> <BODY> <H1>Printing a Window</H1> <FORM> <INPUT TYPE="BUTTON" ONCLICK="printer()" VALUE="Click Me!"> </FORM> </BODY> </HTML> |