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

Posted on 2007-10-10
Last Modified: 2013-12-08
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:
Using this.window.close() but it does not work on IE6 nor IE7
Using Printer.updatePageStatus(-1) , but an error message of Printer is undefined appears.

How to fix this?
Question by:aidinet
    1 Comment
    LVL 75

    Accepted Solution


    <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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Bada platform is becoming more and more famous this days and people talking about same. Some friends included those who have bada OS mobile asked me "what is bada?"and "what its features?". That encouraged me to research and write this article. [st…
    Several part series to implement Internet Explorer 11 Enterprise Mode
    Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
    How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now