1 Reply Latest reply on Jun 5, 2009 8:14 PM by luxspes

    print Preview

      How to write the code to display Browser's print Preview.
      I used the following code.Its working for Html code..But not working for Xhtml.

      <html>
      <head>
      <title></title>
      <script LANGUAGE="JavaScript">
      function displayHTML(printContent) {
      var inf = printContent;
      win = window.open("print.htm", 'popup', 'toolbar = no, status = no');
      win.document.write(inf);
      }
      </script>
      </head>
      <body>
      <div id="printarea">Print this stuff.</div>
      <a href="javascript:void(0);" onclick="displayHTML(printarea.innerHTML)">Print Preview</a>
      </body>
      </html>
        • 1. Re: print Preview

          And what does it do instead? In what browser are you testing it?
          with what version? Have you tried it in Firefox 3.x
          to see if it is sending some error message explaining the problem to the
          Error Console?
          and BTW This is not a seam question (it is IMO a pure JScript question)