This section provides a quick description of the 'window' object of the DOM API. A tutorial example is provided on changing browser window size through the 'window' object.
The DOM API provided by IE browser contains another useful object called "window",
which has the following features:
The "window" object is a browser built-in object that represents the browser window that contains the current HTML document.
The "window" object offers a number of properties and methods to allow you
The "document" object and its "node" objects offers various methods to allow you to manipulate the window.
To illustrate some nice features of the "document" object, I wrote this VBScript tutorial example:
<html>
<!-- Window_Object.html
- Copyright (c) 2015, HerongYang.com, All Rights Reserved.
-->
<head>
<title>Window Object</title>
<script type="text/vbscript">
dim sizeID
sizeID = 0
function changeSize()
if sizeID = 0 then
window.resizeTo 300,300
elseif sizeID = 1 then
window.resizeTo 400,400
elseif sizeID = 2 then
window.resizeTo 500,500
elseif sizeID = 3 then
window.resizeTo 600,600
end if
sizeID = (sizeID+1) mod 4
end function
</script>
</head>
<body>
<p>Hello World!</p>
<p><form>
<input type="button" value="Change" onClick="changeSize()"/>
</form></p>
</body>
</html>
Run this VBScript example in a Web browser, and click the "Change" button.
The browser window will change its size each time you click the button.
For more tutorial examples on the "window" object, see the DOM API chapters in this book.