Technical Training
JavaScript TutorialJavaScript Window Object Open Method Part 2
JavaScript Window Object Open Method Part 2
In this JavaScript tutorial, you will learn about JavaScript Window Object Open Method, features of window object open method - scrollbars, status, titlebar, toolbar, top, width, innerHeight, innerWidth, outerHeight, outerWidth and hotkeys
Ads
scrollbars:
Syntax: scrollbars=yes|no|1|0
The scrollbar feature denotes whether or not the scroll bars should be displayed. The default value of the scrollbars feature is YES, displaying the scroll bars. If the value of the scrollbars feature is set to NO by the user, then the scroll bars are not displayed.
status:
Syntax: status=yes|no|1|0
This allows the user the provision of adding the status bar or not. The default value to the status feature is YES, which adds the status bar. If the user sets the value of the status feature to NO, then the status bar is not added.
titlebar:
Syntax: titlebar=yes|no|1|0
JavaScript provides the option to add the status bar or not and the same option is provided for the visibility of the title bar. The titlebar feature allows the user to denote whether or not the title bar should be displayed. The default value to the titlebar feature is YES, displaying the title bar. If the value of the titlebar feature is set to NO by the user then the title bar is not displayed.
NOTE: this is called only if the application called is an HTML application, otherwise, calling the titlebar feature is not taken into account.
toolbar:
Syntax: toolbar=yes|no|1|0
Like the scroll bar, the toolbar is used to denote whether the browser’s tool bars should be displayed or not. The default value of the toolbar feature is YES, displaying the tool bar. If the value of the toolbar feature is set to NO by the user, then the tool bar is not displayed.
innerHeight:
Syntax: innerHeight=pixels
This feature is used to specify the inner height of the window. The value for this feature is given in pixels.
innerWidth:
Syntax: innerWidth=pixels
This feature is used to specify the inner width of the window. The value for this feature is given in pixels.
outerHeight:
Syntax: outerHeight=pixels
This feature is used to specify the outer height of the window. The value for this feature is given in pixels.
outerWidth:
Syntax: outerWidth=pixels
This feature is used to specify the outer width of the window. The value for this feature is given in pixels.
hotkeys:
Syntax: hotkeys=yes|no|1|0
If the user sets the value of the hotkeys feature to NO, then the window’s usage or function of hotkeys is disabled.
replace:
Another optional attribute that is passed to the open() method of window object is the replace method. This attribute is mentioned in the syntax of the open() method in above description. This specifies the way the entry in the history list is handled. This method is used to specify whether the URL has to create a new entry in the history list or replace the current entry in the history list. The replace attribute can take the values of true or false. The true value specifies that the URL replaces the current document in the history list. The false value specifies that the URL creates a new entry in the history list.
Let us see an example to understand the usage of open() method of window object in brief:
<head> <body> html>
<html>
<script type="text/javascript">
function exforsys()
{
window.open("http://exforsys.com","_blank","toolbar=yes,
location=yes, directories=no, status=yes, menubar=no,
scrollbars=yes, resizable=no, width=300, height=500")
}
script>
head>
<form>
<input type="button" value="Click Here to Display
Window!!!" onclick="exforsys()">
form>
body>
Ads
The output of the above example is a button with the message:

When this button is clicked, the URL http://exforsys.com displays in a new window. This is because the first argument mentioned is http://exforsys.com and the second argument mentioned is _blank, denoting that the URL loads into a new window. The URL displayed in the new window has its window width as 300 and its height as 500. The value of width and height are mentioned as 300 pixels and 500 pixels respectively. The windows displayed have the scroll bars, tool bar, status bar displayed because the value of scrollbars, status and toolbar is set to yes, making these visible in the window. The window displayed is not resizable and is fixed in size because the resizable feature is set to no. The value of the menubar is set to no, displaying no menu bars in the final output window.
JavaScript Tutorial
- JavaScript Browser Objects Part 2
- JavaScript Frame object
- JavaScript Form Object
- JavaScript FileUpload Object
- JavaScript Event Object Properties and Methods
- JavaScript Event Object
- JavaScript Elements and Embed Objects
- JavaScript Applet Objects
- JavaScript Browser Objects
- JavaScript Object Oriented Features
- JavaScript Window Object Open Method Part 2
- JavaScript Window Object Open Method
- JavaScript Window Object Timeout Methods
- JavaScript Location Object
- JavaScript Location Object Properties
- JavaScript History Object Properties and Methods
- JavaScript Document Object Methods Part II
- JavaScript Document Object Methods Part I
- JavaScript Document Object Properties
- JavaScript Document Object
- JavaScript Windows Object Properties Part II
- JavaScript Windows Object Properties Part I
- JavaScript DOM Window Object
- Working with JavaScript DOM Objects
- JavaScript Array Object Methods – Part II
- JavaScript Array Object
- JavaScript Array Object Methods – Part I
- JavaScript Boolean Object
- JavaScript OnError Event
- JavaScript Exception Handling – Part II
- JavaScript Exception Handling – Part I
- JavaScript Event Handler
- JavaScript Events Handling
- JavaScript Array Operations
- JavaScript Two Dimensional Arrays
- Passing values to JavaScript Function
- JavaScript Functions
- JavaScript Arrays
- JavaScript Iterative Structures - Part II
- JavaScript Iterative Structures - Part I
- JavaScript Math Object
- JavaScript Date Object
- JavaScript String Object
- JavaScript Objects
- JavaScript Confirm Box
- JavaScript Alert Box
- JavaScript Conditional Statements Part 2
- JavaScript Conditional Statements Part 1
- How to use JavaScript in HTML page
- JavaScript Variables
- JavaScript Features
- JavaScript Introduction







