(Warning: If using Netscape,
when you close this browser window you will be asked to Grant permission to
the original browser window settings prior to loading the web page.)
Click here to go to a
page where you can download these examples (see Browse Window section)
Browser Window - Simple,
not to techy, examples of opening and closing windows. Some of the windows
do not have toolbars.
Resizing the Browser Window (IE & NS)
- Note: I moved your browser window to the very top cooridinate once the page was loaded
in the function: init(). In that same function I could have resized the window (code
is commented). My saving the originals windows properties and restoring on an I also
store your original settings.
that will resize the window to 640 x 480.
that will resize the window to 300 x 480.
Window's Chrome Properties
- window.menubar.visible - (File, Edit, View, etc...)
- window.toolbar.visible - (Back, Forward, Reload/Refresh, etc...)
- window.locationbar.visible - (URL/Location, etc...)
- window.personalbar.visible - (Custom bar - What's New?, What's Cool?, etc...)
- window.scrollbars.visible - (IE & NN - Right scrollbar, NN - Bottom scrollbar)
- window.statusbar.visible - (the status bar at the bottom of the browser)
Changing the current Window Chrome Items Properties
WARNING - This section only works with
with IE3 and greater but testing with IE5.1 did not work for me.
To change any of the chrome items Java needs to be enabled in the users
browser settings and a call to netscape.security to enable
"UniversalBrowserWrite" must be made. This generally means that the user
may have to "Grant" privilege to perform this function. Also, you may
experience a delay as the Java security applet loads.
- WARNING - before clicking on these links, read the information directly above this
- Click Here - Change Window chrome
items (locationbar, menubar, personalbar, scrollbars,statusbar, toolbar).
- Click Here -
Restore Window chrome items (locationbar, menubar, personalbar, scrollbars,statusbar,
Creating a New Window
- Click Here - Create a new window with no
- Example of creating a new windows with
a name using the open() function.
- A new window is created only if the window by that name does not
exist. If a window by that name does exist it will replace its
- When the window already
exists, the content is change, however the window is not brought to the
front. I don't think it is possible to bring the window to the
front. This maybe confusing to the user.
- Once the window is created, the open() function will not
change the size of the window.
- Example of creating a new windows without
names using the open() function.
- A new window is always created.
- Since a new window is always created the user will have to
continually close the windows.
- The new window is always brought to the front.
(100x200) load with URL ex_window_name_test3A.htm.
(100x400) load with URL ex_window_name_test3B.htm.
experiments with loading a web application which in turn creates a new
browse window so that the new window will be the default window used
to load a URL if one is loaded from a windows application - not your
web application!. This is not a good solution. Remember that
some windows applications will load URL's into the last browser window that
Miscellaneous Window Functions
window is closed. (Later I plan to show how to access the windows via
- Click Here - Example of catching
window events at the "window" level (onClick, onMouseDown, etc...).
- Click Here - Example of
disabling the right mouse button.
- Click Here
-Example of disabling the right mouse button & removing window
bars which will remove the option for the user to "view source"
unless they go directly to the html file.
- Click Here - Examples of hiding
- No example yet - just a note:
if he moves his mouse over the link. This way you can also play with
onMouseover, onMouseout, etc...