Javascript
Changing the features of the Popup window.open method
17-Jul-2009 01:04:38
![]()
You can control the features of the popup using the last argument to the window.open method. The following code opens a window with a status bar and no extra features.
window.open ("http://tutorial.kabarku.com","mywindow","status=1");
The code below opens a window with toolbar and status bar.
window.open ("http://tutorial.kabarku.com",
"mywindow","status=1,toolbar=1");
The table shows the features and the string tokens you can use:
| status | The status bar at the bottom of the window. |
| toolbar | The standard browser toolbar, with buttons such as Back and Forward. |
| location | The Location entry field where you enter the URL. |
| menubar | The menu bar of the window |
| directories | The standard browser directory buttons, such as What's New and What's Cool |
| resizable | Allow/Disallow the user to resize the window. |
| scrollbars | Enable the scrollbars if the document is bigger than the window |
| height | Specifies the height of the window in pixels. (example: height='350') |
| width | Specifies the width of the window in pixels. |
Examples
The following code opens a window with menu bar. The window is resizable and is having 350 pixels width and 250 pixels height.
window.open ("http://tutorial.kabarku.com",
"mywindow","menubar=1,resizable=1,width=350,height=250");
| Reply Comment | ||
| |
||
| |
||