• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1588
  • Last Modified:

window.close() would not work after using print preview

The javascript function window.close not work after the print the window using the print preview and close the print preview window using the [X].
This work if use the close button in the print preview window (IE 6). IE 7 do not have the close button.

I tried the solutions mentioned in these sites:
- http://www.webmasterworld.com/forum21/4506.htm
Using this.window.close() but it does not work on IE6 nor IE7
- http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1629158&SiteID=1
Using Printer.updatePageStatus(-1) , but an error message of Printer is undefined appears.

How to fix this?
1 Solution
Michel PlungjanIT ExpertCommented:

<a href="#"
onClick="window.focus(); window.close(); return false">Close</a>

If that does not work, then I would think you will not get it working.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now