Availability
DOM Level 1 HTML
Synopsis
void open( );
Description
This method erases the current HTML document and begins a new one,
which may be written to with the write( ) and
writeln( ) methods. After calling open(
) to begin a new document and write( )
to specify document content, you must always remember to call
close( ) to end the document and force its content
to be displayed.
This method should not be called by a script or event handler that is
part of the document being overwritten, since the script or handler
will itself be overwritten.
See Document.open( ) in the client-side reference
section, but note that this standardized version of that method can
be used only to create new HTML documents and does not accept the
optional mimetype argument that the Level
version does.
Example
var w = window.open("); // Open a new window
var d = w.document; // Get its HTMLDocument object
d.open(); // Open the document for writing
d.write("<h1>Hello world</h1>"); // Output some HTML to the document
d.close(); // End the document and display itSee Also
HTMLDocument.close( ), HTMLDocument.write( ); Document.open( ) in the
client-side reference section
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.