Exforsys

JavaScript Tutorial

  1. JavaScript Browser Objects Part 2
  2. JavaScript Frame object
  3. JavaScript Form Object
  4. JavaScript FileUpload Object
  5. JavaScript Event Object Properties and Methods
  6. JavaScript Event Object
  7. JavaScript Elements and Embed Objects
  8. JavaScript Applet Objects
  9. JavaScript Browser Objects
  10. JavaScript Object Oriented Features
  11. JavaScript Window Object Open Method Part 2
  12. JavaScript Window Object Open Method
  13. JavaScript Window Object Timeout Methods
  14. JavaScript Location Object
  15. JavaScript Location Object Properties
  16. JavaScript History Object Properties and Methods
  17. JavaScript Document Object Methods Part II
  18. JavaScript Document Object Methods Part I
  19. JavaScript Document Object Properties
  20. JavaScript Document Object
  21. JavaScript Windows Object Properties Part II
  22. JavaScript Windows Object Properties Part I
  23. JavaScript DOM Window Object
  24. Working with JavaScript DOM Objects
  25. JavaScript Array Object Methods – Part II
  26. JavaScript Array Object
  27. JavaScript Array Object Methods – Part I
  28. JavaScript Boolean Object
  29. JavaScript OnError Event
  30. JavaScript Exception Handling – Part II
  31. JavaScript Exception Handling – Part I
  32. JavaScript Event Handler
  33. JavaScript Events Handling
  34. JavaScript Array Operations
  35. JavaScript Two Dimensional Arrays
  36. Passing values to JavaScript Function
  37. JavaScript Functions
  38. JavaScript Arrays
  39. JavaScript Iterative Structures - Part II
  40. JavaScript Iterative Structures - Part I
  41. JavaScript Math Object
  42. JavaScript Date Object
  43. JavaScript String Object
  44. JavaScript Objects
  45. JavaScript Confirm Box
  46. JavaScript Alert Box
  47. JavaScript Conditional Statements Part 2
  48. JavaScript Conditional Statements Part 1
  49. How to use JavaScript in HTML page
  50. JavaScript Variables
  51. JavaScript Features
  52. JavaScript Introduction

Ads


Home arrow Technical Training arrow JavaScript Tutorial

JavaScript Window Object Open Method Part 2

Author : Exforsys Inc.     Published on: 4th Jul 2007    |   Last Updated on: 8th Jul 2007

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:


<
html>

<head>
<
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>

<body>
<
form>
<
input type="button" value="Click Here to Display
Window!!!
" onclick="exforsys()">
form>
body>

html>

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.



 
This tutorial is part of a JavaScript Tutorial tutorial series. Read it from the beginning and learn yourself.

JavaScript Tutorial

  1. JavaScript Browser Objects Part 2
  2. JavaScript Frame object
  3. JavaScript Form Object
  4. JavaScript FileUpload Object
  5. JavaScript Event Object Properties and Methods
  6. JavaScript Event Object
  7. JavaScript Elements and Embed Objects
  8. JavaScript Applet Objects
  9. JavaScript Browser Objects
  10. JavaScript Object Oriented Features
  11. JavaScript Window Object Open Method Part 2
  12. JavaScript Window Object Open Method
  13. JavaScript Window Object Timeout Methods
  14. JavaScript Location Object
  15. JavaScript Location Object Properties
  16. JavaScript History Object Properties and Methods
  17. JavaScript Document Object Methods Part II
  18. JavaScript Document Object Methods Part I
  19. JavaScript Document Object Properties
  20. JavaScript Document Object
  21. JavaScript Windows Object Properties Part II
  22. JavaScript Windows Object Properties Part I
  23. JavaScript DOM Window Object
  24. Working with JavaScript DOM Objects
  25. JavaScript Array Object Methods – Part II
  26. JavaScript Array Object
  27. JavaScript Array Object Methods – Part I
  28. JavaScript Boolean Object
  29. JavaScript OnError Event
  30. JavaScript Exception Handling – Part II
  31. JavaScript Exception Handling – Part I
  32. JavaScript Event Handler
  33. JavaScript Events Handling
  34. JavaScript Array Operations
  35. JavaScript Two Dimensional Arrays
  36. Passing values to JavaScript Function
  37. JavaScript Functions
  38. JavaScript Arrays
  39. JavaScript Iterative Structures - Part II
  40. JavaScript Iterative Structures - Part I
  41. JavaScript Math Object
  42. JavaScript Date Object
  43. JavaScript String Object
  44. JavaScript Objects
  45. JavaScript Confirm Box
  46. JavaScript Alert Box
  47. JavaScript Conditional Statements Part 2
  48. JavaScript Conditional Statements Part 1
  49. How to use JavaScript in HTML page
  50. JavaScript Variables
  51. JavaScript Features
  52. JavaScript Introduction
 

Comments