♦ JavaScript Window
♣ About JAVASCRIPT Window
The browser window can be manipulated in multiple ways.HTML DOM is used for such manipulation.
♣ window.open() in JavaScript
window.open() method is used to open new windows of browser from the JavaScript Block Invocations.A new window is opened can be opened on page loading with browser permission.
Hefty usage can use to bad user experience, that's why most of the browsers block the pop's up by default on page-load.
In this example, a new window named "index.html" is opened.
Note that if no argument is passed then a blank window is opened.
Example
Input:
Output:
♣ window.close() in JavaScript
The current-window/specified-window can be closed in JavaScript.In this example, the current window will be closed.
Example
Input:
Output:
♣ window.moveTo() in JavaScript
The current-window/specified-window can be moved to a particular screen location of the monitor in JavaScript.In this example, specified window is moved .
Example
Input:
Output:
♣ window.resizeTo() in JavaScript
The current-window/specified-window size can be modified in JavaScript.In this example, current window size is modified to 300*300.
Example
Input:
Output: