Loading ...
Sorry, an error occurred while loading the content.

printing a popup (using document.write)

Expand Messages
  • warriorprogrammer
    you need to add document.open and document.close function CreateNewWindow(var1,var2,var3) { descWin= window.open
    Message 1 of 1 , May 17, 2002
    • 0 Attachment
      you need to add document.open and document.close

      <script language="JavaScript">
      function CreateNewWindow(var1,var2,var3) {
      descWin= window.open
      ("","descWindow","scrollbars=no,resizable=1,height=350,width=500");

      //ADD THIS
      descWin.document.open()
      //////////////////////

      descWin.document.writeln
      ('<html><head><title>Testpage</title></head><body>');

      descWin.document.writeln(var1 + "<br><br>");
      descWin.document.writeln(var2 + "<br><br>");
      descWin.document.writeln(var3 + "<br><br>");

      descWin.document.writeln('<a href="javascript:self.print()">
      Print this page with self.print()</a><BR><BR>');
      descWin.document.writeln('<a href="javascript:window.print
      ()"> Print this page with window.print()</a>');

      descWin.document.writeln('</body></html>');

      //ADD THIS
      descWin.document.close()
      //////////////////////
      }
      </script>
    Your message has been successfully submitted and would be delivered to recipients shortly.