|
Free
Javascript
Tutorials
|
|
|
JavaScript Tutorials The Document Object (Part Four) |
||||||||||||||||||||||
|
JavaScript Methods and Events
Let's have a look at those document Methods. They were: open( ), close( ), write( ), writeln( ). We've already done write( ), and writeln( ) is the same as write( ) except that you get a line break. So we'll look (briefly) at open( ) and close( )
open( )We're not going to be using this method, but for reference purposes here's what it does. The default for document.write( ) is to write stuff in the current document window - the browser window. It doesn't need to open a new window, because it already has one to work with. You can use document.open( ) to create a new document and send it things like HTML code. You could send the HTML code with document.write( ) document.open( ) document.write("<H1>Hello</H1>")
|