Producing Web Page Dialog Boxes - Removing or Allowing the Bars
(Page 4 of 4 )
The specs parameter is the one among the four parameters that is used here. Remember that the specs parameter is a comma-separated list of items.
To remove the menu bar, you should type
window.open("","","menubar=no","")
The default specs argument for the menu bar is
“menubar=yes”
That is why you have the menu bar when the specs parameter is “”.
To remove the tool bar, you should type
window.open("","","toolbar=no","")
The default specs argument for the tool bar is
“toolbar=yes”
That is why you have the tool bar when the specs parameter is “”.
To remove the address bar you should type
window.open("","","location=no","")
The default specs argument for the address bar is
“location=yes”
That is why you have the address bar when the specs parameter is “”.
To remove the title bar you should type
window.open("","","titlebar=no","")
The default specs argument for the address bar is
“titlebar=yes”
That is why you the title bar when the specs parameter is “”.
The title bar will always be there by default. I advise you to always allow it.
The open method cannot be used to remove the Links bar. However, when you remove the menu or tool bar, the Links bar normally goes away as well. So we do not have to worry about the removal of a Links bar.
To remove the scroll bars you should type
window.open("","","scrollbars=no","")
The default specs argument for the scrollbars is
“scrollbars=yes”
That is why you have the scrollbars when the specs parameter is “”.
To remove the status bar you should type
window.open("","","status=no","")
The default specs argument for the status bar is
“status=yes”
That is why you have the status bar when the specs parameter is “”. In this series we shall not include the status bar, for simplicity. However, I will show you how to use it below, since you may want this in your own project. Also, if there is an error in your script, the status bar would indicate it, but it wouldn't tell you the exact error.
Specs Arguments for Bars
So far as bars are concerned, you should have as a minimum the following code:
window.open("","","menubar=no,toolbar=no","")
Note how the arguments for the specs parameter are separated by comma(s). IN other words, ‘menubar=no’ is an argument and ‘toolbar=no’ is also an argument. Note how the equal sign is used to choose an option (yes or no).
The Way Browsers Handle Bars
With some browsers, if you remove one bar, all the other bars except the title bar are also removed. With such behavior, if you want a particular bar, you have to include it in the specs parameter.
This is a good place for us to take a break. We will continue in the next part of the series.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |