Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Javascript: close window after printing

Javascript: close window after printing

Scheduled Pinned Locked Moved Web Development
csharpjavascriptquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AlexMarbus
    wrote on last edited by
    #1

    I want a webpage to show the printdialog and close the window when this printdialog is closed: window.print(); window.close(); What am I doing wrong? btw: is it possible to disable/change the header/footer dynamically before the page is printed? -- Alex Marbus www.marbus.net But then again, I could be wrong.

    N 1 Reply Last reply
    0
    • A AlexMarbus

      I want a webpage to show the printdialog and close the window when this printdialog is closed: window.print(); window.close(); What am I doing wrong? btw: is it possible to disable/change the header/footer dynamically before the page is printed? -- Alex Marbus www.marbus.net But then again, I could be wrong.

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      window.print(); should load the print dialog to the screen, however it won't run the window.close(); function until the print dialog has closed by the user hitting the print button or hitting the close button on the dialog. Otherise the code works for me. :) HTH Nick Parker
      **The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown


      **

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups