JavaScript

 

 

 


Lesson 5 Example: Window Object and its Properites

<SCRIPT> <!-- hide code from old browsers
NewWindow=window.open("","","width=200,height=200")
NewWindow.document.write("This is my new window!")
NewWindow.document.close()
//end hiding code -->
</SCRIPT>
    • First a new window is opened using the Window.open method
    • The size of the window is defined using the width and height attributes
    • Next the document which will be displayed in the window is created using the Document.write method.
    • Finally we must close the document

© 2002 Tracy Johnson