This is a read-only property containing a reference to a Bar object whose visible property contains a Boolean value that controls the visibility of the screen furniture represented by the object.
In this case, it is supposed to control the visibility of the menu bar.
The example shows how this can be done in a secure way that requires privilege to be granted and in a non-secure way that does not.
Your script will need to be granted the UniversalBrowserWrite privilege to allow it to change the visibility of the menubar.
The Macintosh version of Netscape Navigator requires that the window be made inactive and then active again after the status of this item has changed for there to be any noticeable effect.
Even then, not all items in the menubar are hidden but most are.
Be careful if you set the menubar and toolbar to invisible, you will then have no reload capability to be able to refresh the screen. You will then only be able to quit.
On some platforms, there may still be a refresh capability available on the contextual menu inside the window. This will depend whether the contextual menu is still available or whether it has been changed to remove the refresh item.
// Request necessary privileges netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); // Hide menu bar window.menubar.visible = false; // There is another way that works without requesting privilege window.open('', '_top', 'menubar=0');
Prev | Home | Next |
Window.locationbar | Up | Window.moveBy() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |