Closing HTML page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Sergio_S
    Indigo Rose Customer
    • Oct 2003
    • 179

    Closing HTML page

    I am using a listbox object to display HTML pages. So far no problem.
    The browser used is the IE 6.0

    Two questions:
    1. Is it possible to hide the menu bar of the browser?

    2. I have included a button to close the browser window displaying the html page.
    <area shape="rect" coords="82,76,150,94" href="javascript:window.close();">

    The button works, but each time the page is displayed and the button is clicked, before the window closes, a dialog is displayed with the message "The web page you are visiting is trying to close the window. You confirm?" This message is not displayed if we click on the Windows close button (X) in the corner of the window.

    How to make the button work without displaying this annoying dialog?
  • Sergio_S
    Indigo Rose Customer
    • Oct 2003
    • 179

    #2
    After looking for a solution, I realize that actually there is no way to control IE window properties for displaying html files from within AMS.

    Workarounds I tested and worked that may be helpful for someone else:

    1. The popup for confirming to close or not a html window in IE is inherent to main windows. Since windows (popups) that have openers can be closed unconditionally, the solution is to make IE think a main window has an opener. That is accomplished by giving a phantom opener a value, in this case, an empty string, like in this example (pls notice the single quotes after window.opener=)

    <a href="javascript: window.opener=''; window.close();">Close Main Window without Confirmation</a>

    2. Other solution is to open a html "dummy" file from AMS that in turn pops up the file we want through the javascript command window.open(). The "dummy" window is closed on loading the popup. Better yet, through this function we also have full control on the IE window properties.

    Sergio.
    Last edited by Sergio_S; 12-07-2006, 06:38 AM.

    Comment

    Working...
    X