script_javascript.html 429 B

123456789101112131415161718192021222324
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <title>Javascript test</title>
  6. </head>
  7. <body>
  8. This page will be printed automatically
  9. <h1>A title</h1>
  10. <script type="text/javascript">
  11. try {
  12. this.print();
  13. }
  14. catch(e) {
  15. window.onload = window.print;
  16. }
  17. </script>
  18. </body>
  19. </html>