window.close() not working in IE after print Preview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joshbay84
    New Member
    • Aug 2009
    • 4

    window.close() not working in IE after print Preview

    window.close() is not working after print preview and close preview window using the window [X]
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Some explanation will be helpful in solving the problem.

    Comment

    • joshbay84
      New Member
      • Aug 2009
      • 4

      #3
      I got some pages that report data to the user. I provide them with a 'printer friendly' link that opens a new window and displays the page in a particular format. This new window has a anchor tag that gives the user an easy way to close the window...

      <a href="javascrip t:" onClick="window .close();">Clos e Window</a>

      It works fine, unless you decide to do ie's print preview function. after returning to the window (from the preview viewing) the link is not working.

      This behavior isn't the same in Mozilla. Mozilla works exactly like I expected it to, w/ or w/o 'print preview'.

      Anybody else experienced this or know how to handle it?

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Try changing the href to a real link, "#" or use a button.

        Comment

        Working...